Dimension (@NotNull Component target, @NotNull Dimension size) { size = new Dimension(size); if (target != myNativeComponent && myNativeComponent instanceof ScalableComponent scalableComponent) { double zoom = scalableComponent.getScale(); if (zoom != 1) { size.width *= zoom; size.height *= zoom; } } return size; }