Skip to content

Commit

Permalink
Merge pull request #34445 from JFonS/fix_13364
Browse files Browse the repository at this point in the history
Fix selection on 3D viewport with half resolution
  • Loading branch information
akien-mga authored Dec 19, 2019
2 parents 791c84b + 8da8518 commit 981c6aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/plugins/spatial_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 981c6aa

Please sign in to comment.