From 8fb7e622a6a4d6651442764e4e22e000f455f77b Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 16 Oct 2021 01:22:57 +0200 Subject: Rename built-in `SGN()` macro to `SIGN()` This matches the name of the GDScript function (except it's uppercase here). --- core/input/input.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/input') 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 &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)); -- cgit v1.2.3