Merge pull request #34274 from MissKraya/34186-fix

Fix for #34186: "Center Selection" in 2D editor introduces graphic bias.
This commit is contained in:
Rémi Verschelde 2019-12-11 19:41:36 +01:00 committed by GitHub
commit cca13462f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

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