Associations often not drawn properly

Issue #36 resolved
Matthias Schoettle created an issue

There are a lot of cases where the end of an association (the arrow, composition polygon, ...) is at another location than the end of the line of the association.

Once, for example, one of the corresponding classes is clicked on, the associations are re-drawn and the association is drawn correctly.

Comments (14)

  1. Matthias Schoettle reporter

    If you enable the border around the invisible box of the association end (which allows to change the type, delete the association and change the navigability), you can see that the position of the box is wrong. And also the position of the multiplicity and role name.

    Once a class is selected, the three components position is corrected.

  2. Matthias Schoettle reporter

    Actually, this makes it hard to "hit" the invisible box, because it doesn't match the position of the line.

    The incorrect position happens during loading of an aspect and when new associations are created (possibly also in some cases when dragging classes).

  3. Matthias Schoettle reporter

    I tracked this bug down and it was introduced in commit 1753aca.

    However, if you load Observer from that version you will not see this problem. If you use the current version of Observer (it has an additional method) it will appear.

  4. Matthias Schoettle reporter

    Resolved issue #36: Reverted one change of commit 1753aca that caused this bug to occur. The from ends position needs to be updated after the to end was processed, because the to end might have changed something (the location of the from end).

    Also, setCorrectPosition of the from end when processing the from end is now disabled, because this should have already been taken care of in the previous call. If this ever causes problems, it should be enabled again.

    → <<cset 8808ab119f86>>

  5. Matthias Schoettle reporter
    • changed status to open

    There is still one issue left. On the attached image the invisible boxes (at the position of the ends) for the events is shown.

    In the case where a straight line can be drawn, because one of the edges is alone, the other end is not updated, but the line is still drawn correctly (because the y of only one end is used).

    Screen Shot 2014-04-11 at 13.35.08.png

  6. Matthias Schoettle reporter
    • changed status to open

    I identified the following problems:

    assoc_edge_case.png

    At first, the class B was to the left, so that both edges on the implementation class were on its left side. Then, I moved B to the position on the screenshot and the other association was drawn incorrectly. The bottom of A and top of the implementation class are almost (pretty much) at the same y-position.

    endAlone.png

    endAlone2.png

    These occur when moving Y (which is located higher, over O) down. Because the ends on X are reordered, some of the associations can be drawn in a straight line, however, the position of the end which is alone on its side is not updated properly.

  7. Matthias Schoettle reporter

    References #36: Adds edge case when bottomYTo and topYFrom are minimally overlapping.

    Causes the edges to stay at LEFT and BOTTOM for slightly longer, otherwise, the line cannot be drawn properly.

    → <<cset 5ced45546c4a>>

  8. Matthias Schoettle reporter

    References #36: Updates end location when drawing line straight.

    When drawAllLines decides to draw the line straight, because one of the ends is alone on its edge, the end's location needs to be updated in order for the texts, which are drawn after the lines, to be moved to the correct position.

    → <<cset b94dcd915a1b>>

  9. Log in to comment