diff --git a/src/component/mxgraph/shape/render/icon-painter.ts b/src/component/mxgraph/shape/render/icon-painter.ts index 45f29ae093..9c4ddaf101 100644 --- a/src/component/mxgraph/shape/render/icon-painter.ts +++ b/src/component/mxgraph/shape/render/icon-painter.ts @@ -29,10 +29,18 @@ import { BpmnCanvas } from './BpmnCanvas'; * @experimental */ export interface PaintParameter { + /** Underlying 'Canvas' in charge of performing the paint operations. */ canvas: mxAbstractCanvas2D; + /** The dimension and the style of the shape where the icon is painted. */ shapeConfig: ShapeConfiguration; + /** The style configuration of the icon. */ iconStyleConfig: IconStyleConfiguration; + /** + * The actual size of the icon will be computed from the shape dimensions using this ratio. The ratio between the original dimensions of the icon are kept. + * If not set, use the dimensions defined in the icon implementation. + */ ratioFromParent?: number; + /** The called function to set the origin of the icon. Generally, it calls a method of {@link BpmnCanvas}. */ setIconOriginFunct: (canvas: BpmnCanvas) => void; } diff --git a/src/component/mxgraph/style/utils.ts b/src/component/mxgraph/style/utils.ts index a88d616111..b6d7e4ce43 100644 --- a/src/component/mxgraph/style/utils.ts +++ b/src/component/mxgraph/style/utils.ts @@ -33,10 +33,15 @@ import { BpmnStyleIdentifier } from './identifiers'; export const StyleDefault = { STROKE_WIDTH_THIN: 2, STROKE_WIDTH_THICK: 5, + /** Margin between the bottom of markers and the bottom of the activity. */ SHAPE_ACTIVITY_BOTTOM_MARGIN: 7, + /** Margin between the top of icon and the top of the activity. */ SHAPE_ACTIVITY_TOP_MARGIN: 7, + /** Margin between the left of icon and the left of the activity. */ SHAPE_ACTIVITY_LEFT_MARGIN: 7, + /** Spacing between 2 markers. */ SHAPE_ACTIVITY_MARKER_ICON_MARGIN: 5, + /** Theoretical width of a marker. Used to position the markers when there are several markers. */ SHAPE_ACTIVITY_MARKER_ICON_SIZE: 20, POOL_LABEL_SIZE: 30, // most of BPMN pool are ok when setting it to 30 POOL_LABEL_FILL_COLOR: 'none',