mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 06:11:29 +03:00
Add GLOBAL_GET cached macros.
GLOBAL_GET is an expensive operation which should not be used each frame / tick. This PR adds macros which do a cheaper revision check, and only call the expensive GLOBAL_GET when project settings have changed. Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
This commit is contained in:
@@ -4071,7 +4071,7 @@ void CanvasItemEditor::set_current_tool(Tool p_tool) {
|
||||
|
||||
void CanvasItemEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
|
||||
EditorNode::get_singleton()->get_scene_root()->set_snap_controls_to_pixels(GLOBAL_GET("gui/common/snap_controls_to_pixels"));
|
||||
EditorNode::get_singleton()->get_scene_root()->set_snap_controls_to_pixels(GLOBAL_GET_CACHED(bool, "gui/common/snap_controls_to_pixels"));
|
||||
|
||||
bool has_container_parents = false;
|
||||
int nb_control = 0;
|
||||
|
||||
Reference in New Issue
Block a user