Skip to content

Commit

Permalink
Render x cross fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyPicky authored and aibcmars committed Oct 21, 2020
1 parent df29611 commit 26c4593
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/component/mxgraph/shape/gateway-shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export class ExclusiveGatewayShape extends GatewayShape {
}

protected paintInnerShape(paintParameter: PaintParameter): void {
this.iconPainter.paintXCrossIcon({ ...paintParameter, setIconOrigin: (canvas: BpmnCanvas) => canvas.setIconOriginToShapeTopLeftProportionally(4) });
this.iconPainter.paintXCrossIcon({
...paintParameter,
icon: { ...paintParameter.icon, isFilled: true },
setIconOrigin: (canvas: BpmnCanvas) => canvas.setIconOriginToShapeTopLeftProportionally(4),
});
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/component/mxgraph/shape/render/IconPainter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,12 @@ export default class IconPainter {
/**
* This icon is used by `exclusive gateway`.
*/
public paintXCrossIcon({ c, ratioFromParent, setIconOrigin, shape, icon }: PaintParameter): void {
const canvas = this.newBpmnCanvas({ c, ratioFromParent, setIconOrigin, shape, icon: { ...icon } }, { height: 0.5, width: 0.5 });
public paintXCrossIcon(paintParameter: PaintParameter): void {
const canvas = this.newBpmnCanvas(paintParameter, { height: 0.5, width: 0.5 });

IconPainter.drawCrossIcon(canvas);
const rotationCenterX = shape.w * ratioFromParent;
const rotationCenterY = shape.h * ratioFromParent;
const rotationCenterX = paintParameter.shape.w * paintParameter.ratioFromParent;
const rotationCenterY = paintParameter.shape.h * paintParameter.ratioFromParent;
canvas.rotate(45, false, false, rotationCenterX, rotationCenterY);
canvas.fillAndStroke();
}
Expand Down

0 comments on commit 26c4593

Please sign in to comment.