Merge pull request #19782 from Calinou/fix-control-pixel-snap-rounding

Fix control pixel snap rounding using floor() instead of round()
This commit is contained in:
Rémi Verschelde 2018-07-04 15:11:08 +02:00 committed by GitHub
commit 3724f1562b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;