Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve JSDoc of PaintParameter and StyleDefault #3049

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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