summaryrefslogtreecommitdiff
path: root/core/input
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-10-16 01:22:57 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-11-16 20:40:49 +0100
commit8fb7e622a6a4d6651442764e4e22e000f455f77b (patch)
treec0a47367d1778fb3903be27067ad0c3731e76668 /core/input
parent5045f46a5c384d83504be3d0cf101e403700b1e3 (diff)
Rename built-in `SGN()` macro to `SIGN()`
This matches the name of the GDScript function (except it's uppercase here).
Diffstat (limited to 'core/input')
-rw-r--r--core/input/input.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp
index 4b5a84f401..6fd8aca01b 100644
--- a/core/input/input.cpp
+++ b/core/input/input.cpp
@@ -714,11 +714,11 @@ Point2i Input::warp_mouse_motion(const Ref<InputEventMouseMotion> &p_motion, con
// detect the warp: if the relative distance is greater than the half of the size of the relevant rect
// (checked per each axis), it will be considered as the consequence of a former pointer warp.
- const Point2i rel_sgn(p_motion->get_relative().x >= 0.0f ? 1 : -1, p_motion->get_relative().y >= 0.0 ? 1 : -1);
+ const Point2i rel_sign(p_motion->get_relative().x >= 0.0f ? 1 : -1, p_motion->get_relative().y >= 0.0 ? 1 : -1);
const Size2i warp_margin = p_rect.size * 0.5f;
const Point2i rel_warped(
- Math::fmod(p_motion->get_relative().x + rel_sgn.x * warp_margin.x, p_rect.size.x) - rel_sgn.x * warp_margin.x,
- Math::fmod(p_motion->get_relative().y + rel_sgn.y * warp_margin.y, p_rect.size.y) - rel_sgn.y * warp_margin.y);
+ Math::fmod(p_motion->get_relative().x + rel_sign.x * warp_margin.x, p_rect.size.x) - rel_sign.x * warp_margin.x,
+ Math::fmod(p_motion->get_relative().y + rel_sign.y * warp_margin.y, p_rect.size.y) - rel_sign.y * warp_margin.y);
const Point2i pos_local = p_motion->get_global_position() - p_rect.position;
const Point2i pos_warped(Math::fposmod(pos_local.x, p_rect.size.x), Math::fposmod(pos_local.y, p_rect.size.y));