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