- final double margin = 1;
- bounds.setFrame(bounds.getMinX() - margin, bounds.getMinY() - margin, bounds.getWidth() + 2*margin, bounds.getHeight() + 2*margin);
+ final double marginX = 1 / selectionTransform.getScaleX();
+ final double marginY = 1 / selectionTransform.getScaleY();
+ bounds.setFrame(bounds.getMinX() - marginX, bounds.getMinY() - marginY, bounds.getWidth() + 2*marginX, bounds.getHeight() + 2*marginY);