import static org.simantics.g2d.canvas.Hints.KEY_CANVAS_TRANSFORM;
-import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
if (d==null) return false;
Set<IElement> selections = selection.getAllSelections();
- Shape bounds = ElementUtils.getElementBoundsOnDiagram(selections);
- if (bounds == null) return false;
- Rectangle2D diagramRect = bounds.getBounds2D();
+ Rectangle2D diagramRect = ElementUtils.getSurroundingElementBoundsOnDiagram(selections);
+ if (diagramRect == null) return false;
if (diagramRect.getWidth() <= 0 && diagramRect.getHeight() <= 0)
return false;