Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Fixed beat controller position to be stationary
Browse files Browse the repository at this point in the history
  • Loading branch information
Fi0x committed Nov 8, 2022
1 parent 25e71b6 commit 6f186c3
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

public class MainMixerWindow extends PApplet
{
//TODO: Maybe all mouse coordinates need to be translated before they can be used
//TODO: They are only translated, when scale is not 1, the coordinates need to be doubled
private PImage icon;
private final int backgroundColor = color(0);
private final int lineColor = color(255);
Expand Down Expand Up @@ -212,6 +210,7 @@ public void mouseReleased()
PVector dist = new PVector(mouseX, mouseY);
dist.add(mouseDragStart.mult(-1));
currentTranslation.add(dist);
beatController.changeLocation((int) -dist.x, (int) -dist.y);
mouseDragStart = null;
}
else if(draggingElement != null)
Expand Down Expand Up @@ -301,7 +300,6 @@ private void selectElement(AbstractElement element)

public PVector transMouse()
{
//TODO: Use correct translation
int correctMouseX = (int) ((mouseX - width / 2) / currentScale - currentTranslation.x);
int correctMouseY = (int) ((mouseY - height / 2) / currentScale - currentTranslation.y);
return new PVector(correctMouseX, correctMouseY);
Expand Down

0 comments on commit 6f186c3

Please sign in to comment.