You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Directly use segment points in Geometry2D/3D function parameters
This commit is contained in:
@@ -620,10 +620,9 @@ EditorPlugin::AfterGUIInput Path3DEditorPlugin::forward_3d_gui_input(Camera3D *p
|
||||
from = gt.xform(from);
|
||||
to = gt.xform(to);
|
||||
if (cdist > 0) {
|
||||
Vector2 s[2];
|
||||
s[0] = viewport->point_to_screen(from);
|
||||
s[1] = viewport->point_to_screen(to);
|
||||
Vector2 inters = Geometry2D::get_closest_point_to_segment(mbpos, s);
|
||||
const Vector2 segment_a = viewport->point_to_screen(from);
|
||||
const Vector2 segment_b = viewport->point_to_screen(to);
|
||||
Vector2 inters = Geometry2D::get_closest_point_to_segment(mbpos, segment_a, segment_b);
|
||||
float d = inters.distance_to(mbpos);
|
||||
|
||||
if (d < 10 && d < closest_d) {
|
||||
|
||||
Reference in New Issue
Block a user