mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00: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:
parent
8edf97e342
commit
f8f350a32a
48 changed files with 110 additions and 77 deletions
|
|
@ -4532,7 +4532,7 @@ Control *EditorHelpBitTooltip::show_tooltip(Control *p_target, const String &p_s
|
|||
// Copy-paste from `Viewport::_gui_show_tooltip()`.
|
||||
void EditorHelpBitTooltip::popup_under_cursor() {
|
||||
Point2 mouse_pos = get_mouse_position();
|
||||
Point2 tooltip_offset = GLOBAL_GET("display/mouse_cursor/tooltip_position_offset");
|
||||
Point2 tooltip_offset = GLOBAL_GET_CACHED(Point2, "display/mouse_cursor/tooltip_position_offset");
|
||||
Rect2 r(mouse_pos + tooltip_offset, get_contents_minimum_size());
|
||||
r.size = r.size.min(get_max_size());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue