X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Fdiagram%2Fparticipant%2FElementPainter.java;h=eb9e33607d5500197cc7c4fd8d0c061036d835c3;hp=d69ef69c69fadec257a3e07e2fc31a600cd5ed15;hb=560d8aa2e37cb6b0249aec6d7e96e67d5a64c59f;hpb=7ebd0005704fe333211591ccacdaa26d7c7639ac diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/ElementPainter.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/ElementPainter.java index d69ef69c6..eb9e33607 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/ElementPainter.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/ElementPainter.java @@ -1012,8 +1012,9 @@ public class ElementPainter extends AbstractDiagramParticipant implements Compos Shape shape = ElementUtils.getElementShapeOrBounds(e); Rectangle2D bounds = shape.getBounds2D(); //System.out.println("selection bounds: "+bounds); - 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); List ss = e.getElementClass().getItemsByClass(SelectionSpecification.class); if (!ss.isEmpty()) {