-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Extend CanvasItem::draw_circle()
, making it also draw unfilled circle.
#84472
Extend CanvasItem::draw_circle()
, making it also draw unfilled circle.
#84472
Conversation
CanvasItem::draw_circle()
, making it possible to draw unfilled circle, like draw_rect()
.
CanvasItem::draw_circle()
, making it possible to draw unfilled circle, like draw_rect()
.CanvasItem::draw_circle()
, making it also draw unfilled circle.
Please see this |
Random thought but already too late for it, I noticed that the circle-drawing pipelines could easily be extended for ellipses without any overhead. I'll try to remember to bring this up for 5.0 |
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.
Also consider the suggestion for adding an antialiased parameter, and documenting that it only works for unfilled. |
e910b0c
to
18493f3
Compare
Beside this PR I find there are several other inconsistencies in the |
This was not necessarily a suggestion in the proposal, so I'd say it should be added now instead of later And new functionality shouldn't add to the inconsistencies IMO |
Let me explain. The inconsistencies include:
I plan to address them step by step, instead of mixed all things in one big PR. The plan is:
edit:
|
OK! I look forward. I think this is good as is. |
Actually, maybe @dalexeev has something to say about this, having worked on draw_rect() a while back. I remember daleexev struggling to figure out whether increasing width should make the rect's stroke should grow inward, outward, or in both directions. |
This can be done in a backwards-compatible way by adding |
f118cd3
to
3a9262f
Compare
The Mono build always give error, because of some API mismatching. But I am not sure how should I proceed to solve it, can someone shed some light? |
It's fine, you don't need to change anything. Edit: Nevermind, sorry |
Good to know, thanks! |
This is false, you need to provide compatibility methods, this is for GDExtension, this is required when ever additional arguments are added, take a look in other files which have a |
eb1e30e
to
88e7471
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.
LGTM, will need some dedicated render review to be sure but it matches the general method for this
Just some minor nitpicks
700f56e
to
e281cd1
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.
I suggest adding a final antialiased
parameter that defaults to false
, and passes this parameter to canvas_item_add_polyline()
.
That is currently handled in a separate follow-up PR: But I'd agree that doing it in one PR is most convenient and makes it less cumbersome compatibility wise |
f66f4ae
to
012e43c
Compare
done |
@AThousandShips Might this PR be considered to be moved to 4.3? The change is relatively straightforward and small in scope, yet the improve in user convenience is considerable. |
No rush 🙂 it still needs some further review by render the render team before it can be decided on merger This addition might be straightforward, but we need to be careful about how we decide to go with it so we don't have to change it and break compatibility in the future, so a thought through decision is needed |
Fair enough, thanks for the explanation. |
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.
Should now be moved to the 4.2 file since it exists
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.
done
012e43c
to
7f98430
Compare
7f98430
to
701ad73
Compare
d0941d9
to
a9b157d
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.
Tested locally (rebased on top of master
6118592), it works as expected in all rendering methods, with and without HDR 2D enabled.
Testing project: test-draw-circle.zip
Needs a rebase, and then this should be mergeable. |
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.
Just a minor detail
…d options Make it possible to draw unfilled circle, like draw_rect(). Antialising is only implemented for unfilled version.
a9b157d
to
1f2aa17
Compare
Thanks! |
filled
andwidth
parameters todraw_circle
godot-proposals#7761