mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Fixed juttery movements when zooming and sometimes tracking.
Need to look into getting the boat propery fixed in the center. #story[1121]
This commit is contained in:
@@ -229,7 +229,6 @@ public class GameClient {
|
|||||||
positionData.getLon(), positionData.getHeading(),
|
positionData.getLon(), positionData.getHeading(),
|
||||||
positionData.getGroundSpeed());
|
positionData.getGroundSpeed());
|
||||||
}
|
}
|
||||||
raceView.getGameView().trackBoat();
|
|
||||||
} else if (positionData.getType() == DeviceType.MARK_TYPE) {
|
} else if (positionData.getType() == DeviceType.MARK_TYPE) {
|
||||||
//CompoundMark mark = courseData.getCompoundMarks().get(positionData.getDeviceId());
|
//CompoundMark mark = courseData.getCompoundMarks().get(positionData.getDeviceId());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,15 +91,15 @@ public class GameView extends Pane {
|
|||||||
double scaleFactor = 1;
|
double scaleFactor = 1;
|
||||||
|
|
||||||
public void zoomOut() {
|
public void zoomOut() {
|
||||||
scaleFactor = 0.05;
|
scaleFactor = 0.95;
|
||||||
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 = 0.05;
|
scaleFactor = 1.05;
|
||||||
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,12 @@ public class GameView extends Pane {
|
|||||||
double y = boat.getBoatLayoutY();
|
double y = boat.getBoatLayoutY();
|
||||||
double displacementX = this.getWidth();
|
double displacementX = this.getWidth();
|
||||||
double displacementY = this.getHeight();
|
double displacementY = this.getHeight();
|
||||||
this.setLayoutX((-x + ((displacementX)/2.0)) * this.getScaleX());
|
// double displacementX = 1200d;
|
||||||
this.setLayoutY((-y + ((displacementY)/2.0)) * this.getScaleY());
|
// double displacementY = 900d;
|
||||||
|
System.out.println("displacementY = " + displacementY);
|
||||||
|
System.out.println("displacementX = " + displacementX);
|
||||||
|
this.setLayoutX((-x + (displacementX/2.0)) * this.getScaleX());
|
||||||
|
this.setLayoutY((-y + (displacementY/2.0)) * this.getScaleY());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isBoatSelected) {
|
if (!isBoatSelected) {
|
||||||
@@ -153,6 +157,7 @@ public class GameView extends Pane {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(long now) {
|
public void handle(long now) {
|
||||||
|
trackBoat();
|
||||||
if (lastTime == 0) {
|
if (lastTime == 0) {
|
||||||
lastTime = now;
|
lastTime = now;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user