From daa47a7f04ac7b5e6be6d810fea1c360e3ac8695 Mon Sep 17 00:00:00 2001 From: Fi0x Date: Sun, 13 Nov 2022 18:50:57 +0100 Subject: [PATCH] Fixed beat controller buttons for .exe version --- .../com/fi0x/cc/project/mixer/gui/BeatController.java | 9 ++++++--- .../com/fi0x/cc/project/mixer/gui/MainMixerWindow.java | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/fi0x/cc/project/mixer/gui/BeatController.java b/src/main/java/com/fi0x/cc/project/mixer/gui/BeatController.java index 1d1cf51..a7a520b 100644 --- a/src/main/java/com/fi0x/cc/project/mixer/gui/BeatController.java +++ b/src/main/java/com/fi0x/cc/project/mixer/gui/BeatController.java @@ -67,10 +67,13 @@ public boolean interact(int x, int y) return false; } - public void updateLocation(int addedX, int addedY) + public void updateLocation(int xPos, int yPos, int xOffset, int yOffset) { - offsetX += addedX; - offsetY += addedY; + controlX = xPos; + controlY = yPos; + + offsetX += xOffset; + offsetY += yOffset; } public void updateScale(float scaleMultiplier) { diff --git a/src/main/java/com/fi0x/cc/project/mixer/gui/MainMixerWindow.java b/src/main/java/com/fi0x/cc/project/mixer/gui/MainMixerWindow.java index ecd7d9b..618146e 100644 --- a/src/main/java/com/fi0x/cc/project/mixer/gui/MainMixerWindow.java +++ b/src/main/java/com/fi0x/cc/project/mixer/gui/MainMixerWindow.java @@ -209,7 +209,7 @@ public void mouseReleased() PVector dist = new PVector(mouseX, mouseY); dist.add(mouseDragStart.mult(-1)); currentTranslation.add(dist); - beatController.updateLocation((int) -dist.x, (int) -dist.y); + beatController.updateLocation(-width / 2, -height / 2, (int) -dist.x, (int) -dist.y); mouseDragStart = null; } else if(draggingElement != null)