*/
public static final Key POPUP_MENU_HIDDEN = new KeyOf(Long.class, "POPUP_MENU_HIDDEN");
+ /**
+ * For specifying a user-defined padding for selections
+ *
+ * @since 1.33.0
+ */
+ public static final Key SELECTION_PADDING_SCALE_FACTOR = new KeyOf(Double.class, "SELECTION_PADDING_SCALE_FACTOR");
+
}
} else {
SelectionNode s = selectionNode.getOrCreateNode(getNodeId("shape", e), SelectionNode.class);
s.init(selectionTransform, bounds, color);
+ Double paddingFactor = diagram.getHint(DiagramHints.SELECTION_PADDING_SCALE_FACTOR);
+ if (paddingFactor != null)
+ s.setPaddingFactor(paddingFactor);
}
}
protected transient BasicStroke scaledStroke;
protected transient double previousScaleRecip = Double.NaN;
private boolean ignore = false;
+ private double paddingFactor = 5.0;
public void setIgnore(boolean value) {
ignore = value;
}
+
+ public void setPaddingFactor(double factor) {
+ paddingFactor = factor;
+ }
@SyncField({"transform", "bounds", "color"})
public void init(AffineTransform transform, Rectangle2D bounds, Color color) {
}
g.setStroke(scaledStroke);
- double padding = 5.0 * scaleRecip;
+ double padding = paddingFactor * scaleRecip;
double paddingX = padding;
double paddingY = padding;