fix: storage chest ui would be shifted to left and any mouse button would trigger the action

This commit is contained in:
minjaesong
2023-06-17 23:19:09 +09:00
parent 0ff71f39fe
commit 4cc52b5585
10 changed files with 112 additions and 60 deletions

View File

@@ -49,7 +49,7 @@ class UIQuickslotPie : UICanvas() {
// update controls
if (handler.isOpened || handler.isOpening) {
val cursorPos = Vector2(Terrarum.mouseScreenX.toDouble(), Terrarum.mouseScreenY.toDouble())
val centre = Vector2(Toolkit.drawWidth / 2.0, App.scr.halfh.toDouble())
val centre = Vector2(Toolkit.hdrawWidth.toDouble(), App.scr.halfh.toDouble())
val deg = -(centre - cursorPos).direction.toFloat()
selection = Math.round(deg * slotCount / FastMath.TWO_PI)