Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imprecise mouse event recognition of RSBezier #509

Open
JanBliznicenko opened this issue Feb 26, 2023 · 1 comment
Open

Imprecise mouse event recognition of RSBezier #509

JanBliznicenko opened this issue Feb 26, 2023 · 1 comment

Comments

@JanBliznicenko
Copy link
Contributor

JanBliznicenko commented Feb 26, 2023

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?

example

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.
@akevalion
Copy link
Contributor

moved to pharo-graphics/Roassal

@akevalion akevalion reopened this Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants