mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-14 10:30:24 +00:00
Fix rectangle drawing in zoomed image editor.
This commit is contained in:
parent
f1f00fff4b
commit
0dcf9d31e2
@ -280,8 +280,8 @@ public class AppleImageEditor extends ImageEditor implements EventHandler<MouseE
|
|||||||
|
|
||||||
private void startSelection(int x, int y) {
|
private void startSelection(int x, int y) {
|
||||||
selectRect = new Rectangle(1, 1, Color.NAVY);
|
selectRect = new Rectangle(1, 1, Color.NAVY);
|
||||||
selectRect.setTranslateX(x);
|
selectRect.setTranslateX(x * xScale * zoom);
|
||||||
selectRect.setTranslateY(y);
|
selectRect.setTranslateY(y * yScale * zoom);
|
||||||
selectRect.setOpacity(0.5);
|
selectRect.setOpacity(0.5);
|
||||||
selectStartX = x;
|
selectStartX = x;
|
||||||
selectStartY = y;
|
selectStartY = y;
|
||||||
@ -293,10 +293,10 @@ public class AppleImageEditor extends ImageEditor implements EventHandler<MouseE
|
|||||||
startSelection(x, y);
|
startSelection(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
double minX = Math.min(selectStartX, x) * xScale;
|
double minX = Math.min(selectStartX, x) * xScale * zoom;
|
||||||
double minY = Math.min(selectStartY, y) * yScale;
|
double minY = Math.min(selectStartY, y) * yScale * zoom;
|
||||||
double maxX = Math.max(selectStartX, x) * xScale;
|
double maxX = Math.max(selectStartX, x) * xScale * zoom;
|
||||||
double maxY = Math.max(selectStartY, y) * yScale;
|
double maxY = Math.max(selectStartY, y) * yScale * zoom;
|
||||||
selectRect.setTranslateX(minX);
|
selectRect.setTranslateX(minX);
|
||||||
selectRect.setTranslateY(minY);
|
selectRect.setTranslateY(minY);
|
||||||
selectRect.setWidth(maxX - minX);
|
selectRect.setWidth(maxX - minX);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user