From cd1ec1bd38f33247edc539ecfb6b4fccbc739554 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:49:08 +0100 Subject: [PATCH] docs: improve JSDoc of PaintParameter and StyleDefault Document the purpose of some properties in StyleDefault related to activity icons and markers. --- src/component/mxgraph/shape/render/icon-painter.ts | 5 +++++ src/component/mxgraph/style/utils.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/component/mxgraph/shape/render/icon-painter.ts b/src/component/mxgraph/shape/render/icon-painter.ts index 12ed9714e5..01c67b0185 100644 --- a/src/component/mxgraph/shape/render/icon-painter.ts +++ b/src/component/mxgraph/shape/render/icon-painter.ts @@ -29,10 +29,15 @@ import { BpmnCanvas } from './BpmnCanvas'; * @experimental */ export interface PaintParameter { + /** mxgraph `mxAbstractCanvas2D` 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. 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 ee6a6ad322..575a38d664 100644 --- a/src/component/mxgraph/style/utils.ts +++ b/src/component/mxgraph/style/utils.ts @@ -33,11 +33,16 @@ 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, SHAPE_ACTIVITY_FROM_CENTER_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',