Answered

Revsersing the direction of lines does not switch the line.startWidgetId and line.endWidgetId

  • 13 November 2020
  • 2 replies
  • 682 views

Steps to reproduce :

  1. Connect to widgets using an arrow line.
  2. Click on the line and reverse it from the menuon top.

Expected behaviour:

Line.endWidgetId == the id of widget the arrow line points to. 

And

Line.startWidgetId == the id of the widget the arrow starts from. 

Actual behavior :

Line.startWidgetId == the id of widget the arrow line points to. 

And

Line.endWidgetId == the id of the widget the arrow starts from.

icon

Best answer by Viktor Razumov 16 November 2020, 11:21

View original

2 replies

Userlevel 1

Hi Mohsen,

 

Currently, the start and end widget ids are set once when the line is created, that unfortunately doesn’t reflect the logical representation of lines after you change the direction.

 

As a workaround, I’d suggest checking the style.lineStartStyle and style.lineEndStyle properties of a line object against the miro.enums.lineArrowheadStyle enum to identify the current direction of a line.

 

Hope, this helps.

Userlevel 7
Badge +5

Yah… good call out  @Mohsen 

the “reverse” button on widgetContextMenu for a line seems to be ~ “swap the arrowhead types for this line...while leaving the start and end connections unchanged”  
 

Reconnecting / swapping the line ends on the board itself gives the actual desired effect - of reversing startWidgetId and end…

 

Easy for that to get muddled by users… in which case checking arrowheads like @Viktor Razumov  says, seems to be the best way to get to the user’s intended meaning of the arrow. 

Reply