Closed NicolasAnquetil closed 8 months ago
Hi Nicolas,
Marker mid only works for lines with more than 2 control points. RSLine only has 2 control points then you should use a RSPolyline
| c b1 b2 e1 |
c := RSCanvas new.
b1 := RSBox new size: 10 ; color: Color red.
b1 position: 20@20.
b2 := RSBox new size: 10; color: Color green.
b2 position: 50@0.
b1 draggable.
b2 draggable.
e1 := RSPolyline new
from: b1; to: b2.
e1 controlPointsController: (RSBlockCPController new block: [:edge | | a b |
a := edge from position.
b := edge to position.
{a.
a + b / 2.
b }. ]).
e1 markerMid: (RSCircle new size: 5 ; color: Color yellow).
c addAll: { b1. b2. e1 }.
c @ RSCanvasController new noLegend.
^ c
ha, ok thanks for letting me know. But:
... controlPointsController: (RSBlockCPController ...
black magic?
It should be hidden in the RSPolyline and/or #markerMid behaviorthanks
script example:
No yellow circle in the middle of the line :-(