void (@NotNull Rectangle bounds, @NotNull Rectangle fromScreen, @NotNull Rectangle toScreen) { checkScreensNonEmpty(fromScreen, toScreen); double kw = toScreen.getWidth() / fromScreen.getWidth(); double kh = toScreen.getHeight() / fromScreen.getHeight(); bounds.setRect( toScreen.x + (bounds.x - fromScreen.x) * kw, toScreen.y + (bounds.y - fromScreen.y) * kh, bounds.width * kw, bounds.height * kh ); }