summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-12-11 19:41:36 +0100
committerGitHub <noreply@github.com>2019-12-11 19:41:36 +0100
commitcca13462f1803a18ba8bfde99e9f79a9e7b84156 (patch)
tree59c74471fbfacd2d28733f4e68d854c30ae33ecd /editor
parent98c3990f7dc6064123938a9c8fc7ee1bb4a30c2b (diff)
parent4da0d7727feae28a59969592b634104d51214b22 (diff)
Merge pull request #34274 from MissKraya/34186-fix
Fix for #34186: "Center Selection" in 2D editor introduces graphic bias.
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index d5dc74c134..544e0b69f1 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -4938,8 +4938,8 @@ void CanvasItemEditor::_focus_selection(int p_op) {
center = rect.position + rect.size / 2;
Vector2 offset = viewport->get_size() / 2 - editor->get_scene_root()->get_global_canvas_transform().xform(center);
- view_offset.x -= offset.x / zoom;
- view_offset.y -= offset.y / zoom;
+ view_offset.x -= Math::round(offset.x / zoom);
+ view_offset.y -= Math::round(offset.y / zoom);
update_viewport();
} else { // VIEW_FRAME_TO_SELECTION