You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
Rename built-in SGN() macro to SIGN()
This matches the name of the GDScript function (except it's uppercase here).
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user