From 7ddbf934f7ac8f9a57a4b14d78ddd7068e6fd136 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Fri, 30 Apr 2021 14:51:22 +0200 Subject: [PATCH] Element.kt: Keep the original x and y coordinates in memory --- common/src/main/kotlin/fr/username404/snowygui/gui/Element.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/Element.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/Element.kt index 08319e2..2da1772 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/Element.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/Element.kt @@ -8,9 +8,10 @@ import fr.username404.snowygui.Snowy fun interface Renderable { fun render(poseStack: PoseStack?) } abstract class Element( - var x: Double, var y: Double, + @JvmField val xOrigin: Double, @JvmField val yOrigin: Double, val width: Int, val height: Int ): Renderable { + var x = xOrigin; var y = yOrigin companion object Rendering { private var caughtError: Boolean = false @JvmStatic protected val tessellator: Tesselator = Tesselator.getInstance()