You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create few points and link them by lines. Once you select some lines, if any two of them have intersection, the graph will move strangely. The standard should be the case that no matter how many lines you select, the graph should move in a whole. But now every points and lines are moving differently.
The text was updated successfully, but these errors were encountered:
This is the bug that has been addressed in #1 , It is related to the definition of the translate function in the Line class. Basically, translate method is invoked for each of the line class, where both line segments try to move that connect point together. This creates a strange behavior. However, translate method in Line Segment class should not depend on SelectTool's selections. Trying to naively fix this bug might cause dependency problem, and difficulties in maintaining the codes in the future. It is often known as "Technology Debt".
One way to improve the whole design would be to forbid two lines to be selected at the same time, since doing so has no immediate meaning.
However, the latter approach would introduce LineSegment dependency of the SelectTool, which is not good. (still better than the first design). If you REALLY want to fix this, use the latter design.
Also, before trying to solve the problem, please lookup design patterns. Research patterns as "Strategy Pattern", "Dependency Inversion", "Observer Pattern". If you do not understand these terms, please ask Kaijie Cai @kjcai for help. He is familiar with those patterns.
Create few points and link them by lines. Once you select some lines, if any two of them have intersection, the graph will move strangely. The standard should be the case that no matter how many lines you select, the graph should move in a whole. But now every points and lines are moving differently.
The text was updated successfully, but these errors were encountered: