set the position on illegal position

This commit is contained in:
Martin Beyer
2021-08-24 17:38:01 +02:00
parent b529764eb4
commit 58d65c609f

View File

@@ -45,14 +45,26 @@ public class ResizeController implements FxController {
blResizer.setOnMouseDragged(this::resizeBottomLeft);
brResizer.setOnMouseDragged(this::resizeBottomRight);
window.setY(settings.windowYPositionProperty().get());
window.setX(settings.windowXPositionProperty().get());
window.setHeight(settings.windowHeightProperty().get());
//TODO: remove comments
//window.setHeight(settings.windowHeightProperty().get() > window.getMaxHeight() ? window.getMaxHeight() * 0.95 : settings.windowHeightProperty().get());
window.setWidth(settings.windowWidthProperty().get());
//window.setWidth(settings.windowWidthProperty().get() > window.getMaxWidth() ? window.getMaxWidth() * 0.95 : settings.windowWidthProperty().get());
//TODO: define illegalPosition
boolean illegalPosition = false;
if (illegalPosition) {
// if the position is illegal, then the window appears on the main screen in the middle of the window.
window.setY((window.getMaxHeight() - window.getHeight()) / 2);
window.setX((window.getMaxWidth() - window.getWidth()) / 2);
}
else {
window.setX(settings.windowXPositionProperty().get());
window.setY(settings.windowYPositionProperty().get());
}
}
private void startResize(MouseEvent evt) {