From 534309439cd5da20cdaf4fc843b2c1ad19a147a7 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Wed, 9 Sep 2020 16:05:56 +0900 Subject: [PATCH] UI is now rendered in correct pos --- .../torvald/terrarum/ui/UIItemHorizontalFadeSlide.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/net/torvald/terrarum/ui/UIItemHorizontalFadeSlide.kt b/src/net/torvald/terrarum/ui/UIItemHorizontalFadeSlide.kt index 4340de32a..4c9b2f212 100644 --- a/src/net/torvald/terrarum/ui/UIItemHorizontalFadeSlide.kt +++ b/src/net/torvald/terrarum/ui/UIItemHorizontalFadeSlide.kt @@ -23,10 +23,10 @@ class UIItemHorizontalFadeSlide( init { // re-position the uis according to the initial choice of currentPosition uis.forEachIndexed { index, it -> - it.posX = posX + getOffX(index) - it.initialX = posX + getOffX(index) - it.posY = posY - it.initialY = posY + it.posX = 0 + getOffX(index) + it.initialX = 0 + getOffX(index) + it.posY = 0 + it.initialY = 0 it.opacity = getOpacity(index) } } @@ -34,7 +34,7 @@ class UIItemHorizontalFadeSlide( override fun onTransition(currentPosition: Float, uis: Array) { uis.forEachIndexed { index, it -> it.posX = it.initialX + getOffX(index) - it.posY = posY + it.posY = it.initialY it.opacity = getOpacity(index) } }