Restored auto snapping of controls to pixels, fixes #10847 and probably several more issues. Made it optional in the project settings but defaults to true.

This commit is contained in:
Juan Linietsky
2017-09-07 11:22:07 -03:00
parent 895140389a
commit 1eeda0f32f
5 changed files with 36 additions and 0 deletions

View File

@@ -1249,6 +1249,10 @@ void Control::_size_changed() {
new_size_cache.height = MAX(minimum_size.height, new_size_cache.height);
}
if (get_viewport()->is_snap_controls_to_pixels_enabled()) {
new_size_cache =new_size_cache.floor();
new_pos_cache = new_pos_cache.floor();
}
bool pos_changed = new_pos_cache != data.pos_cache;
bool size_changed = new_size_cache != data.size_cache;