Roassal3
Roassal3 copied to clipboard
Imprecise mouse event recognition of RSBezier
I would like to use RSBezier
instead of RSPolyline
in OpenPonk for state machines and other kinds of diagrams that would look better with beziers.
In OpenPonk, it is important for user to "select" the line with mouse click (user does that a lot), but it does not work very well with RSBezier
as the includesPoint
approximation using lines
is very imprecise (for my use case).
For beziers with 4 control points, increasing number of these lines help, but with only 3 control points, those lines are completely off.
Is there any possibility for improvement without having drastic effect on performance for larger drawings?
c := RSCanvas new.
bezier := RSBezier new.
bezier
width: 2;
color: Color black;
controlPoints: {-200@(-200). 0@400. 200@(-200)}.
bezier @ RSHighlightable red.
c add: bezier.
bezier lines overlappingPairsDo: [:from :to| c add: (RSLine new color: Color veryVeryLightGray; from: from; to: to; yourself)].
c open.
moved to pharo-graphics/Roassal