Description
Describe the current behavior
In the NAD viewer, with enableLevelOfDetail = true and the text nodes are not visualized, when moving a voltage level node, the text edges are not correctly moved
Describe the expected behavior
In the NAD viewer, with enableLevelOfDetail = true and the text nodes are not visualized, when moving a voltage level node, the text edges are correctly moved
Describe the steps
In the NAD viewer, with enableLevelOfDetail = true
Zooming out so that the text nodes are not visualized
Then moving a voltage level node
And zooming in, so that the text nodes are again visualized
the text node is correctly moved, along the voltage level node, but the text edge is not, connecting to the wrong point.
Moving again the voltage level node, or the text node, when the text node is visualized, fixes the connection.
Environment
No response
Relevant Log Output
No response
Extra Information
The viewer, when moving text edges, gets the size of the text nodes using scrollHeight and scrollWidth properties of the div inside the foreignObject of the text node. The size is used for correctly move the text edges, attaching it to the proper points.
When enableLevelOfDetail = true and text nodes are not visualized, both scrollHeight and scrollWidth preoperties are 0.
A recent hotfix, put for correctly moving text nodes programmatically (see PR #126), does not compute the end of text edges if scrollHeight and scrollWidth preoperties are 0 (they are 0 when moving text nodes programmatically, in these cases the end of text edges is computed before, and the text edge is connected correctly).
So, when the size is 0 because the thext node are not visualized, the the text edge is connected to the wrong point: 0,0, as in the example above, or to the previous computed text edge end, if a movement was done with the text nodes visualized.
Even changing the code, for distinguishing if the size is 0,0 because the text node is moved programmatically or not, and so computing the text edge when needed, the viewer would possibly connect the edge to the wrong point, when the connection is not the default one, see below