From d65b604a7eeba341189bc27113dccb14160f6d07 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 7 Jan 2023 00:24:09 -0800 Subject: [PATCH] Fix relationship style. --- packages/mindplot/src/components/Relationship.ts | 5 +---- packages/web2d/src/components/peer/svg/CurvedLinePeer.js | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/mindplot/src/components/Relationship.ts b/packages/mindplot/src/components/Relationship.ts index c8e706f1..0a01e7aa 100644 --- a/packages/mindplot/src/components/Relationship.ts +++ b/packages/mindplot/src/components/Relationship.ts @@ -47,10 +47,7 @@ class Relationship extends ConnectionLine { private _model: RelationshipModel; constructor(sourceNode: Topic, targetNode: Topic, model: RelationshipModel) { - $assert(sourceNode, 'sourceNode can not be null'); - $assert(targetNode, 'targetNode can not be null'); - - super(sourceNode, targetNode); + super(sourceNode, targetNode, LineType.THIN_CURVED); this._model = model; const strokeColor = Relationship.getStrokeColor(); diff --git a/packages/web2d/src/components/peer/svg/CurvedLinePeer.js b/packages/web2d/src/components/peer/svg/CurvedLinePeer.js index b2b29d38..4a3bd37e 100644 --- a/packages/web2d/src/components/peer/svg/CurvedLinePeer.js +++ b/packages/web2d/src/components/peer/svg/CurvedLinePeer.js @@ -134,7 +134,7 @@ class CurvedLinePeer extends ElementPeer { setWidth(value) { this._width = value; - if (this._width >= 1) { + if (this._width > 1) { this._style.fill = this._fill; } else { this._fill = this._style.fill; @@ -157,7 +157,7 @@ class CurvedLinePeer extends ElementPeer { const curveP5 = CurvedLinePeer._pointToStr(this._control1.x + this._x1, this._control1.y + this._y1 + this.getWidth() * 0.7); const curveP6 = CurvedLinePeer._pointToStr(this._x1, this._y1 + this.getWidth() / 2); - const path = `M${moveTo} C${curveP1} ${curveP2} ${curveP3} ${this.getWidth() >= 1 ? ` ${curveP4} ${curveP5} ${curveP6} Z` : ''}`; + const path = `M${moveTo} C${curveP1} ${curveP2} ${curveP3} ${this.getWidth() > 1 ? ` ${curveP4} ${curveP5} ${curveP6} Z` : ''}`; this._native.setAttribute('d', path); } }