|
@ -70,7 +70,7 @@ class NodeBase { |
|
|
/** |
|
|
/** |
|
|
* |
|
|
* |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {{toArrow: boolean, toArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), toArrowType: *, middleArrow: boolean, middleArrowScale: (number|allOptions.edges.arrows.middle.scaleFactor|{number}|Array), middleArrowType: (allOptions.edges.arrows.middle.type|{string}|string|*), fromArrow: boolean, fromArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), fromArrowType: *, arrowStrikethrough: (*|boolean|allOptions.edges.arrowStrikethrough|{boolean}), color: undefined, inheritsColor: (string|string|string|allOptions.edges.color.inherit|{string, boolean}|Array|*), opacity: *, hidden: *, length: *, shadow: *, shadowColor: *, shadowSize: *, shadowX: *, shadowY: *, dashes: (*|boolean|Array|allOptions.edges.dashes|{boolean, array}), width: *}} values |
|
|
|
|
|
|
|
|
* @param {ArrowOptions} values |
|
|
*/ |
|
|
*/ |
|
|
enableShadow(ctx, values) { |
|
|
enableShadow(ctx, values) { |
|
|
if (values.shadow) { |
|
|
if (values.shadow) { |
|
@ -84,7 +84,7 @@ class NodeBase { |
|
|
/** |
|
|
/** |
|
|
* |
|
|
* |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {{toArrow: boolean, toArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), toArrowType: *, middleArrow: boolean, middleArrowScale: (number|allOptions.edges.arrows.middle.scaleFactor|{number}|Array), middleArrowType: (allOptions.edges.arrows.middle.type|{string}|string|*), fromArrow: boolean, fromArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), fromArrowType: *, arrowStrikethrough: (*|boolean|allOptions.edges.arrowStrikethrough|{boolean}), color: undefined, inheritsColor: (string|string|string|allOptions.edges.color.inherit|{string, boolean}|Array|*), opacity: *, hidden: *, length: *, shadow: *, shadowColor: *, shadowSize: *, shadowX: *, shadowY: *, dashes: (*|boolean|Array|allOptions.edges.dashes|{boolean, array}), width: *}} values |
|
|
|
|
|
|
|
|
* @param {ArrowOptions} values |
|
|
*/ |
|
|
*/ |
|
|
disableShadow(ctx, values) { |
|
|
disableShadow(ctx, values) { |
|
|
if (values.shadow) { |
|
|
if (values.shadow) { |
|
@ -98,7 +98,7 @@ class NodeBase { |
|
|
/** |
|
|
/** |
|
|
* |
|
|
* |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {{toArrow: boolean, toArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), toArrowType: *, middleArrow: boolean, middleArrowScale: (number|allOptions.edges.arrows.middle.scaleFactor|{number}|Array), middleArrowType: (allOptions.edges.arrows.middle.type|{string}|string|*), fromArrow: boolean, fromArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), fromArrowType: *, arrowStrikethrough: (*|boolean|allOptions.edges.arrowStrikethrough|{boolean}), color: undefined, inheritsColor: (string|string|string|allOptions.edges.color.inherit|{string, boolean}|Array|*), opacity: *, hidden: *, length: *, shadow: *, shadowColor: *, shadowSize: *, shadowX: *, shadowY: *, dashes: (*|boolean|Array|allOptions.edges.dashes|{boolean, array}), width: *}} values |
|
|
|
|
|
|
|
|
* @param {ArrowOptions} values |
|
|
*/ |
|
|
*/ |
|
|
enableBorderDashes(ctx, values) { |
|
|
enableBorderDashes(ctx, values) { |
|
|
if (values.borderDashes !== false) { |
|
|
if (values.borderDashes !== false) { |
|
@ -120,7 +120,7 @@ class NodeBase { |
|
|
/** |
|
|
/** |
|
|
* |
|
|
* |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {{toArrow: boolean, toArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), toArrowType: *, middleArrow: boolean, middleArrowScale: (number|allOptions.edges.arrows.middle.scaleFactor|{number}|Array), middleArrowType: (allOptions.edges.arrows.middle.type|{string}|string|*), fromArrow: boolean, fromArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), fromArrowType: *, arrowStrikethrough: (*|boolean|allOptions.edges.arrowStrikethrough|{boolean}), color: undefined, inheritsColor: (string|string|string|allOptions.edges.color.inherit|{string, boolean}|Array|*), opacity: *, hidden: *, length: *, shadow: *, shadowColor: *, shadowSize: *, shadowX: *, shadowY: *, dashes: (*|boolean|Array|allOptions.edges.dashes|{boolean, array}), width: *}} values |
|
|
|
|
|
|
|
|
* @param {ArrowOptions} values |
|
|
*/ |
|
|
*/ |
|
|
disableBorderDashes(ctx, values) { |
|
|
disableBorderDashes(ctx, values) { |
|
|
if (values.borderDashes !== false) { |
|
|
if (values.borderDashes !== false) { |
|
@ -157,7 +157,7 @@ class NodeBase { |
|
|
/** |
|
|
/** |
|
|
* |
|
|
* |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {{toArrow: boolean, toArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), toArrowType: *, middleArrow: boolean, middleArrowScale: (number|allOptions.edges.arrows.middle.scaleFactor|{number}|Array), middleArrowType: (allOptions.edges.arrows.middle.type|{string}|string|*), fromArrow: boolean, fromArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), fromArrowType: *, arrowStrikethrough: (*|boolean|allOptions.edges.arrowStrikethrough|{boolean}), color: undefined, inheritsColor: (string|string|string|allOptions.edges.color.inherit|{string, boolean}|Array|*), opacity: *, hidden: *, length: *, shadow: *, shadowColor: *, shadowSize: *, shadowX: *, shadowY: *, dashes: (*|boolean|Array|allOptions.edges.dashes|{boolean, array}), width: *}} values |
|
|
|
|
|
|
|
|
* @param {ArrowOptions} values |
|
|
*/ |
|
|
*/ |
|
|
initContextForDraw(ctx, values) { |
|
|
initContextForDraw(ctx, values) { |
|
|
var borderWidth = values.borderWidth / this.body.view.scale; |
|
|
var borderWidth = values.borderWidth / this.body.view.scale; |
|
@ -170,7 +170,7 @@ class NodeBase { |
|
|
/** |
|
|
/** |
|
|
* |
|
|
* |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {{toArrow: boolean, toArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), toArrowType: *, middleArrow: boolean, middleArrowScale: (number|allOptions.edges.arrows.middle.scaleFactor|{number}|Array), middleArrowType: (allOptions.edges.arrows.middle.type|{string}|string|*), fromArrow: boolean, fromArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), fromArrowType: *, arrowStrikethrough: (*|boolean|allOptions.edges.arrowStrikethrough|{boolean}), color: undefined, inheritsColor: (string|string|string|allOptions.edges.color.inherit|{string, boolean}|Array|*), opacity: *, hidden: *, length: *, shadow: *, shadowColor: *, shadowSize: *, shadowX: *, shadowY: *, dashes: (*|boolean|Array|allOptions.edges.dashes|{boolean, array}), width: *}} values |
|
|
|
|
|
|
|
|
* @param {ArrowOptions} values |
|
|
*/ |
|
|
*/ |
|
|
performStroke(ctx, values) { |
|
|
performStroke(ctx, values) { |
|
|
var borderWidth = values.borderWidth / this.body.view.scale; |
|
|
var borderWidth = values.borderWidth / this.body.view.scale; |
|
@ -191,7 +191,7 @@ class NodeBase { |
|
|
/** |
|
|
/** |
|
|
* |
|
|
* |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {CanvasRenderingContext2D} ctx |
|
|
* @param {{toArrow: boolean, toArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), toArrowType: *, middleArrow: boolean, middleArrowScale: (number|allOptions.edges.arrows.middle.scaleFactor|{number}|Array), middleArrowType: (allOptions.edges.arrows.middle.type|{string}|string|*), fromArrow: boolean, fromArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), fromArrowType: *, arrowStrikethrough: (*|boolean|allOptions.edges.arrowStrikethrough|{boolean}), color: undefined, inheritsColor: (string|string|string|allOptions.edges.color.inherit|{string, boolean}|Array|*), opacity: *, hidden: *, length: *, shadow: *, shadowColor: *, shadowSize: *, shadowX: *, shadowY: *, dashes: (*|boolean|Array|allOptions.edges.dashes|{boolean, array}), width: *}} values |
|
|
|
|
|
|
|
|
* @param {ArrowOptions} values |
|
|
*/ |
|
|
*/ |
|
|
performFill(ctx, values) { |
|
|
performFill(ctx, values) { |
|
|
// draw shadow if enabled
|
|
|
// draw shadow if enabled
|
|
|