-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Conversation
Can anybody please review this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this enhancement 👍
@@ -206,9 +206,9 @@ if (typeof CanvasRenderingContext2D !== 'undefined') { | |||
|
|||
|
|||
/** | |||
* Draw an arrow point (no line) | |||
* Draw an arrow an the end of an line with the given angle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two typos: "an the end of an" -> "at the end of a"
@@ -491,8 +495,13 @@ class EdgeBase { | |||
ctx.fillStyle = ctx.strokeStyle; | |||
ctx.lineWidth = this.getLineWidth(selected, hover); | |||
|
|||
// draw arrow at the end of the line | |||
ctx.arrow(arrowData.point.x, arrowData.point.y, arrowData.angle, arrowData.length); | |||
if (arrowData.type && arrowData.type.toLowerCase() === 'circle') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Should we better have something like an enum type holding the different edge types (circle, arrow, ...)? Then the types would be stored in one place rather than distributed through the whole code as strings. However, for now this isn't a problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Idea! Let'd do that if more edge types are implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
@yotamberk Could you please have a look at this!? I consider this a basis to implement further edge-types and not a completed new feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great enhancement!
Make it possible to also define an
type
of edge-endpoint (arrow
orcircle
):implements #1993