ConnectionNode holder = e.getHint(sgKey);
if (holder == null) {
holder = parentNode.addNode(ElementUtils.generateNodeId(e), ConnectionNode.class);
+ holder.setKey(e.getHint(ElementHints.KEY_OBJECT));
holder.setTransferableProvider(new ElementTransferableProvider(getContext(), e));
e.setHint(sgKey, holder);
holder.setZIndex(parentNode.getNodeCount() + 1);
SingleElementNode holder = e.getHint(sgKey);
if (holder == null) {
holder = parentNode.addNode(ElementUtils.generateNodeId(e), SingleElementNode.class);
+ holder.setKey(e.getHint(ElementHints.KEY_OBJECT));
holder.setTransferableProvider(new ElementTransferableProvider(getContext(), e));
e.setHint(sgKey, holder);
holder.setZIndex(parentNode.getNodeCount() + 1);
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<SelectionSpecification> ss = e.getElementClass().getItemsByClass(SelectionSpecification.class);
if (!ss.isEmpty()) {