hedgewars/uLandOutline.pas
changeset 10197 c57798251b55
parent 10189 875607ce793d
child 10483 1f58cb4aa773
--- a/hedgewars/uLandOutline.pas	Fri Mar 14 13:59:39 2014 +0400
+++ b/hedgewars/uLandOutline.pas	Fri Mar 14 16:00:36 2014 +0400
@@ -113,17 +113,8 @@
     Vx:= int2hwFloat(p1.X - p3.X);
     Vy:= int2hwFloat(p1.Y - p3.Y);
 
-    d:= DistanceI(p2.X - p1.X, p2.Y - p1.Y);
-    d1:= DistanceI(p2.X - p3.X, p2.Y - p3.Y);
     d2:= Distance(Vx, Vy);
 
-    if d1 < d then
-        d:= d1;
-    if d2 < d then
-        d:= d2;
-
-    d:= d * _1div3;
-
     if d2.QWordValue = 0 then
         begin
         Vx:= _0;
@@ -131,12 +122,18 @@
         end
     else
         begin
-        d2:= _1 / d2;
+        d:= DistanceI(p2.X - p1.X, p2.Y - p1.Y);
+        d1:= DistanceI(p2.X - p3.X, p2.Y - p3.Y);
+        
+        if d1 < d then
+            d:= d1;
+        if d2 < d then
+            d:= d2;
+
+        d2:= d * _1div3 / d2;
+        
         Vx:= Vx * d2;
-        Vy:= Vy * d2;
-
-        Vx:= Vx * d;
-        Vy:= Vy * d
+        Vy:= Vy * d2
         end
 end;