From 7816e73d7481874b3f50ebf00d46c5e496cf846e Mon Sep 17 00:00:00 2001 From: gianpaolopalma Date: Tue, 22 Mar 2011 18:17:52 +0000 Subject: [PATCH] Changed "int lenght" to "ScalarType lenght" in ClosestPoint function. --- vcg/space/segment2.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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)