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;
*******************************************************************************/
package org.simantics.modeling.actions;
-import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
if (controlBounds == null || controlBounds.isEmpty())
return false;
- final Shape shp = ElementUtils.getElementBoundsOnDiagram(selection);
- if (shp == null)
+ Rectangle2D diagramRect = ElementUtils.getSurroundingElementBoundsOnDiagram(selection);
+ if (diagramRect == null)
return false;
ThreadUtils.asyncExec(canvas.getThreadAccess(), new Runnable() {
if (canvas.isDisposed())
return;
- Rectangle2D diagramRect = shp.getBounds2D();
-
// Make sure that even empty bounds can be zoomed into.
org.simantics.scenegraph.utils.GeometryUtils.expandRectangle(diagramRect, 1);