diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-12-19 14:47:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-19 14:47:34 +0100 |
commit | 981c6aa102ba50d314a023a96d7affb7081334e5 (patch) | |
tree | d980430d0bb97066e6b459dc9ff9074f8a3bfe61 | |
parent | 791c84bbbb76908aaa70f91276578766b2a630ac (diff) | |
parent | 8da8518ba37f4fbc4d0475eee4de7807fd4a1e2f (diff) |
Merge pull request #34445 from JFonS/fix_13364
Fix selection on 3D viewport with half resolution
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 10e4559805..b590fc5ed1 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -298,6 +298,7 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, Vector3 ray = _get_ray(p_pos); Vector3 pos = _get_ray_pos(p_pos); + Vector2 shrinked_pos = p_pos / viewport_container->get_stretch_shrink(); Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario()); Set<Ref<EditorSpatialGizmo> > found_gizmos; @@ -326,7 +327,7 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, Vector3 normal; int handle = -1; - bool inters = seg->intersect_ray(camera, p_pos, point, normal, &handle, p_alt_select); + bool inters = seg->intersect_ray(camera, shrinked_pos, point, normal, &handle, p_alt_select); if (!inters) continue; |