Skip to content

Commit

Permalink
docs: improve JSDoc of PaintParameter and StyleDefault
Browse files Browse the repository at this point in the history
Document the purpose of some properties in StyleDefault related to activity icons and markers.
  • Loading branch information
tbouffard committed Mar 25, 2024
1 parent be1b50b commit 2060e06
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/component/mxgraph/shape/render/icon-painter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
5 changes: 5 additions & 0 deletions src/component/mxgraph/style/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 2060e06

Please sign in to comment.