-
-
Notifications
You must be signed in to change notification settings - Fork 23.5k
Rename CanvasItem.update() to queue_redraw()
#64377
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
Conversation
6e08105 to
59b4f83
Compare
|
We've discussed this in a bikeshedding meeting, and were convinced that a rename would be beneficial here. But we suggest using |
|
There are occasions where godot/editor/plugins/tiles/tile_data_editors.cpp Lines 701 to 718 in dc4193b
By the naming conventions I've seen, is it still a good idea to rename the internal method |
Yes? That's pretty normal even for user scripts.
What do you mean? We're renaming the public method to make it clearer what it does, so the internal one needs to be renamed as well to avoid any confusion for engine developers. The name would be something |
|
Oh I see! I assumed the starting underscore was mostly reserved for virtual or private methods. I am a little confused on |
Again, public method is changed from |
|
Oooh I see, I understand it all now. Thank you very much |
dd0a9e5 to
6478db9
Compare
|
Updated the PR to use |
ce438a8 to
7c7216f
Compare
CanvasItem.update() to redraw()CanvasItem.update() to queue_redraw()
e23a360 to
c666574
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 am tentatively ready to approve this, but it needs another rebase and quick look in case you accidentally renamed stuff you shouldn't have or missed stuff that you should've renamed (though unlikely if you've only did the bulk of changes in various cpp files).
Edit: Also, you didn't rename _update_callback to _redraw_callback?
I think it's important to indicate that the method has no immediate effect. We use |
I first forgot, then I thought of doing it in another PR but it doesn't hurt to just do it now at this point. Won't take too much. |
c666574 to
c027035
Compare
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on. Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency. Just a few comments have also been changed to say "redraw". In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
c027035 to
e31bb5f
Compare
|
All done, I had checked one more time. |
YuriSizov
left a comment
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.
Changeset seems good now. Didn't check every single line, but in principle it should be correct if the CI passes
* Godot 4.0 beta 1 import file updates * API rename: `update` is now `queue_redraw` Per godotengine/godot#64377 * API rename: `x2y` functions are now `x_to_y` Per godotengine/godot#64367 * Update types: `UndoRedo` is now an internal of `EditorUndoRedoManager` Per godotengine/godot#59564 * beta 3 Co-authored-by: Jeff <[email protected]>


Closes godotengine/godot-proposals#5190.
As brought up in #54161 (comment), #54161 (comment) and Should CanvasItem.
update()be renamed torequest_redraw()orredraw().Affects a lot of classes. This PR is absolutely, utterly GARGANTUAN.
I very thoroughly checked signal connections and deferred calls to this method,
add_do_method/add_undo_methodcalls, and so on. Just a few comments have also been changed to say "redraw". It's ENTIRELY possible I still missed something, but the engine compiles, at least!Also renames the internal
_update_callback()to_redraw_callback()for consistency.In CPUParticles2D, there was a private variable with the same name. For now, this has been renamed to
do_redraw. It's either that, or something close. I haven't exactly understood what it's meant for.This PR was previously renaming it to redraw()