diff --git a/vcg/space/segment2.h b/vcg/space/segment2.h index 21305ab5..61b2201b 100644 --- a/vcg/space/segment2.h +++ b/vcg/space/segment2.h @@ -146,12 +146,11 @@ typedef Segment2 Segment2d; template Point2 ClosestPoint( Segment2 s, const Point2 & p) { - vcg::Line2 l; + vcg::Line2 l; l.Set(s.P0(),s.P1()-s.P0()); - l = l.Normalize(); ScalarType t = l.Projection(p); Point2 clos = l.P(t); - int lenght = s.Length(); + ScalarType lenght = s.Length(); if (t <= 0) return s.P0(); else if (t >= lenght)