-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
CanvasItem::draw_polyline
Support thin polylines drawn using line strip
#71679
Conversation
3d56d15
to
8b28cf0
Compare
I have tested this PR, works correctly and consistent with #69851. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Should be fine to merge once the error is changed to a warning (or an ERR_CONTINUE if you prefer)
8b28cf0
to
728c51e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Thanks! |
Follow-up to #69851 aiming to solve the remaining parts:
This PR makes the
width
parameter for the methods listed above work consistently with the other methods changed in #69851 i.e.width < 0
results in drawing thin polyline using line strip (arc is drawn as polyline too). Forwidth >= 0
a scalable polyline is drawn using triangle strips, this is unchanged.In the changed methods I've made antialiasing not supported for
width < 0
. In some methods unchanged by this PR e.g. inCanvasItem::draw_line
antialiasing forwidth < 0
is "supported" but it's done in the same manner as for thewidth >= 0
case. This results in a buggy behavior because at different zoom levels the line itself remains thin but the triangle strips used for antialiasing do scale. Hence I haven't added similar antialiasing "support" for thin polylines.I haven't changed other methods but I do think it would make sense to make them consistent by making antialiasing not supported for
width < 0
(can be done in a separate PR).Compat-breaking because just as #69851 this PR changes the default value for
width
to-1.0
so the thin polylines are drawn by default (so if someone was not passing a width then now they will get unscalable thin polylines instead of the scalable ones).Resolves #44332.
Resolves godotengine/godot-proposals#1363 (combined with #69851).
cc @dalexeev
Bugsquad edit:
Fully resolves #19844 (according to @dalexeev)