summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-07-04 15:11:08 +0200
committerGitHub <noreply@github.com>2018-07-04 15:11:08 +0200
commit3724f1562be5caca3c5236c1cfac8d73a3303d42 (patch)
tree51e72655c3d71721ae1bcb34196c0f3858ca9dd7 /scene/gui
parent92bfde531cea21555dc74ad928a79120fbc9c34d (diff)
parent88c23e243f05696b2c3d56caad8055046e5edcd3 (diff)
Merge pull request #19782 from Calinou/fix-control-pixel-snap-rounding
Fix control pixel snap rounding using floor() instead of round()
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/control.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 289924976d..fb0cec5212 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -1335,8 +1335,8 @@ void Control::_size_changed() {
// We use a little workaround to avoid flickering when moving the pivot with _edit_set_pivot()
if (Math::abs(Math::sin(data.rotation * 4.0f)) < 0.00001f && get_viewport()->is_snap_controls_to_pixels_enabled()) {
- new_size_cache = new_size_cache.floor();
- new_pos_cache = new_pos_cache.floor();
+ new_size_cache = new_size_cache.round();
+ new_pos_cache = new_pos_cache.round();
}
bool pos_changed = new_pos_cache != data.pos_cache;
bool size_changed = new_size_cache != data.size_cache;