Skip to content

Commit 2aa958a

Browse files
committed
Fix Y moving animation
1 parent 79ca2b1 commit 2aa958a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/kotlin/com/lambda/client/module/modules/client/Notifications.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,17 @@ object Notifications : Module(
6969
val scaledResolution = ScaledResolution(mc)
7070
val vertexHelper = VertexHelper(GlStateUtils.useVbo())
7171

72-
notifications.forEachIndexed { index, notification ->
72+
var y = 0.0
73+
notifications.forEach { notification ->
7374
GlStateManager.pushMatrix()
7475
when (renderLocation) {
7576
RenderLocation.BOTTOM_RIGHT -> GL11.glTranslatef((scaledResolution.scaledWidth_double - horizontalPadding - 90).toFloat(), (scaledResolution.scaledHeight_double - verticalPadding - notificationHeight).toFloat(), 0f)
7677
RenderLocation.BOTTOM_LEFT -> GL11.glTranslatef(horizontalPadding, (scaledResolution.scaledHeight_double - verticalPadding - notificationHeight).toFloat(), 0f)
7778
RenderLocation.TOP_RIGHT -> GL11.glTranslatef((scaledResolution.scaledWidth_double - horizontalPadding - 90).toFloat(), verticalPadding, 0f)
7879
RenderLocation.TOP_LEFT -> GL11.glTranslatef(horizontalPadding, verticalPadding, 0f)
7980
}
80-
GlStateManager.translate(0.0, index * renderLocation.yValue * ((notificationHeight + 3.0) * notification.animate()), 0.0)
81+
y += renderLocation.yValue * ((notificationHeight + 3.0) * notification.animate())
82+
GlStateManager.translate(0.0, y, 0.0)
8183
drawNotification(vertexHelper, notification)
8284
GlStateManager.popMatrix()
8385
}

0 commit comments

Comments
 (0)