maxX = Math.max(maxX, screen.getVisualBounds().getMaxX());
maxY = Math.max(maxY, screen.getVisualBounds().getMaxY());
}
Rectangle2D bounds = getScreenBounds(primaryMoveNode);
Rectangle2D valid = bounds;
if (!isValidBounds(bounds)) {
if (bounds.getMinY() < minY || bounds.getMaxY() > maxY) {
int dir = 1;
if (bounds.getMaxY() > maxY) {
dir = -1;
}
for (double y = minX; y <= maxY && y >= minY; y += dir) {
Rectangle2D test = cloneRect(bounds, null, y, null, null);
if (isValidBounds(test)) {
valid = test;
}
}
}