mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Progress made on the improper tracking of boats (boats aren't being correctly centered).
This commit is contained in:
@@ -95,15 +95,15 @@ public class GameView extends Pane {
|
||||
double scaleFactor = 1;
|
||||
|
||||
public void zoomOut() {
|
||||
scaleFactor = 0.95;
|
||||
this.setScaleX(this.getScaleX() * scaleFactor);
|
||||
this.setScaleY(this.getScaleY() * scaleFactor);
|
||||
scaleFactor = 0.1;
|
||||
this.setScaleX(this.getScaleX() - scaleFactor);
|
||||
this.setScaleY(this.getScaleY() - scaleFactor);
|
||||
}
|
||||
|
||||
public void zoomIn() {
|
||||
scaleFactor = 1.05;
|
||||
this.setScaleX(this.getScaleX() * scaleFactor);
|
||||
this.setScaleY(this.getScaleY() * scaleFactor);
|
||||
scaleFactor = 0.10;
|
||||
this.setScaleX(this.getScaleX() + scaleFactor);
|
||||
this.setScaleY(this.getScaleY() + scaleFactor);
|
||||
}
|
||||
|
||||
private enum ScaleDirection {
|
||||
@@ -118,8 +118,17 @@ public class GameView extends Pane {
|
||||
double y = selectedBoat.getBoatLayoutY();
|
||||
double displacementX = this.getWidth();
|
||||
double displacementY = this.getHeight();
|
||||
// this.setLayoutX((-x) );
|
||||
// this.setLayoutY((-y) );
|
||||
|
||||
// System.out.println("displacementX = " + displacementX);
|
||||
// System.out.println("panelWidth = " + panelWidth);
|
||||
// System.out.println("displacementY = " + displacementY);
|
||||
// System.out.println("panelHeight = " + panelHeight);
|
||||
this.setLayoutX((-x + (displacementX / 2.0)) * this.getScaleX());
|
||||
this.setLayoutY((-y + (displacementY / 2.0)) * this.getScaleY());
|
||||
// this.setLayoutX((-x + (canvasWidth / 2.0)) * this.getScaleX());
|
||||
// this.setLayoutY((-y + (canvasHeight / 2.0)) * this.getScaleY());
|
||||
|
||||
// boolean isBoatSelected = false;
|
||||
// for (BoatObject boat : boatObjects.values()) {
|
||||
|
||||
Reference in New Issue
Block a user