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;
|
double scaleFactor = 1;
|
||||||
|
|
||||||
public void zoomOut() {
|
public void zoomOut() {
|
||||||
scaleFactor = 0.95;
|
scaleFactor = 0.1;
|
||||||
this.setScaleX(this.getScaleX() * scaleFactor);
|
this.setScaleX(this.getScaleX() - scaleFactor);
|
||||||
this.setScaleY(this.getScaleY() * scaleFactor);
|
this.setScaleY(this.getScaleY() - scaleFactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void zoomIn() {
|
public void zoomIn() {
|
||||||
scaleFactor = 1.05;
|
scaleFactor = 0.10;
|
||||||
this.setScaleX(this.getScaleX() * scaleFactor);
|
this.setScaleX(this.getScaleX() + scaleFactor);
|
||||||
this.setScaleY(this.getScaleY() * scaleFactor);
|
this.setScaleY(this.getScaleY() + scaleFactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum ScaleDirection {
|
private enum ScaleDirection {
|
||||||
@@ -118,8 +118,17 @@ public class GameView extends Pane {
|
|||||||
double y = selectedBoat.getBoatLayoutY();
|
double y = selectedBoat.getBoatLayoutY();
|
||||||
double displacementX = this.getWidth();
|
double displacementX = this.getWidth();
|
||||||
double displacementY = this.getHeight();
|
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.setLayoutX((-x + (displacementX / 2.0)) * this.getScaleX());
|
||||||
this.setLayoutY((-y + (displacementY / 2.0)) * this.getScaleY());
|
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;
|
// boolean isBoatSelected = false;
|
||||||
// for (BoatObject boat : boatObjects.values()) {
|
// for (BoatObject boat : boatObjects.values()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user