On Jun 8, 2014, at 4:00 PM, Alexandre Bergel <alexandre.bergel@me.com> wrote:

- in the last example, why is the arrow offset between yellow and green? There is only one arrow so there is no need for offsets.

There is no offset between yellow and green I think. This effect is the result of the shortest distance algo I think

To come back on this, I don’t know if it is because of the shortest distance algorithm or not, but it can get quite strange:


Same code as in your example (below), just dragged the yellow circle around a bit.

-=-=-=-=-=-=-=-=-=-=-=-=
| v e1 e2 e3 e4 line |
v := RTView new.
e1 := (RTEllipse new color: (Color blue alpha: 0.4); size: 20) element.
e2 := (RTEllipse new color: (Color red alpha: 0.4); size: 20) element.
e3 := (RTEllipse new color: (Color yellow alpha: 0.4); size: 20) element.
e4 := (RTEllipse new color: (Color green alpha: 0.4); size: 20) element.
e1 @ RTDraggable.
e2 @ RTDraggable.
e3 @ RTDraggable.
e4 @ RTDraggable.

v add: e1; add: e2; add: e3; add: e4.

line := RTArrow new color: Color red.
line withOffsetIfMultiple.
v add: (line  edgeFrom: e1 to: e2).
v add: (line  edgeFrom: e2 to: e1).
v add: (line  edgeFrom: e1 to: e2).

v add: (line  edgeFrom: e2 to: e2).

v add: (line  edgeFrom: e3 to: e4).

RTCircleLayout on: { e1 . e2 . e3 . e4 }.
v
-=-=-=-=-=-=-=-=-=-=-=-=

---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile