Rectangle (@NotNull Component target, @NotNull Rectangle bounds) { if (target != myNativeComponent && myNativeComponent instanceof ScalableComponent scalableComponent) { double zoom = scalableComponent.getScale(); if (zoom != 1) { bounds = new Rectangle(bounds); bounds.x *= zoom; bounds.y *= zoom; bounds.width *= zoom; bounds.height *= zoom; } } return myNativeComponent == target ? new Rectangle(bounds) : SwingUtilities.convertRectangle(myNativeComponent, bounds, target); }