diff options
| author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-03-03 14:37:52 +0100 |
|---|---|---|
| committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-05-02 10:31:13 +0200 |
| commit | 308dbb8c6359589ce7411027cecd777938e40bd7 (patch) | |
| tree | 80a8cf2eff0d0c1ef1e7e0913b8616e0ee4e376a /platform | |
| parent | f91db3dc58f1d6a0cb63d591515183b5a45cd3ba (diff) | |
| download | redot-engine-308dbb8c6359589ce7411027cecd777938e40bd7.tar.gz | |
[Core] Add scalar versions of `Vector*` `min/max/clamp/snap(ped)`
Convenience for a number of cases operating on single values
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/linuxbsd/wayland/wayland_thread.cpp | 2 | ||||
| -rw-r--r-- | platform/linuxbsd/x11/display_server_x11.cpp | 2 | ||||
| -rw-r--r-- | platform/macos/display_server_macos.mm | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/platform/linuxbsd/wayland/wayland_thread.cpp b/platform/linuxbsd/wayland/wayland_thread.cpp index 3a63b87c7a..1701aa650d 100644 --- a/platform/linuxbsd/wayland/wayland_thread.cpp +++ b/platform/linuxbsd/wayland/wayland_thread.cpp @@ -2461,7 +2461,7 @@ void WaylandThread::_wp_tablet_tool_on_frame(void *data, struct zwp_tablet_tool_ // According to the tablet proto spec, tilt is expressed in degrees relative // to the Z axis of the tablet, so it shouldn't go over 90 degrees either way, // I think. We'll clamp it just in case. - td.tilt = td.tilt.clamp(Vector2(-90, -90), Vector2(90, 90)); + td.tilt = td.tilt.clampf(-90, 90); mm->set_tilt(td.tilt / 90); diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index e854fe9274..b76cbc126f 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -2225,7 +2225,7 @@ void DisplayServerX11::window_set_size(const Size2i p_size, WindowID p_window) { ERR_FAIL_COND(!windows.has(p_window)); Size2i size = p_size; - size = size.max(Size2i(1, 1)); + size = size.maxi(1); WindowData &wd = windows[p_window]; diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index 5e48602da4..cfa4041147 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -2321,7 +2321,7 @@ void DisplayServerMacOS::window_set_window_buttons_offset(const Vector2i &p_offs WindowData &wd = windows[p_window]; float scale = screen_get_max_scale(); wd.wb_offset = p_offset / scale; - wd.wb_offset = wd.wb_offset.max(Vector2i(12, 12)); + wd.wb_offset = wd.wb_offset.maxi(12); if (wd.window_button_view) { [wd.window_button_view setOffset:NSMakePoint(wd.wb_offset.x, wd.wb_offset.y)]; } |
