tweaking hogpointer position again
authorsheepluva
Mon, 16 Jun 2014 02:41:03 +0200
changeset 10313 769061317dc5
parent 10312 eda8d563f677
child 10314 6691ebaa4f3a
tweaking hogpointer position again
hedgewars/uGearsRender.pas
--- a/hedgewars/uGearsRender.pas	Mon Jun 16 02:23:37 2014 +0200
+++ b/hedgewars/uGearsRender.pas	Mon Jun 16 02:41:03 2014 +0200
@@ -972,7 +972,13 @@
                 t:= 32;//trunc((SpritesData[sprFinger].Height + t) / cScaleFactor);
                 ty := min(ty, ViewBottomY - 96);
                 // don't overlap with HH or HH tags
-                if ty < ViewTopY + t then ty:= max(ViewTopY + t, oy + t);
+                if ty < ViewTopY + t then
+                    begin
+                    if abs(tx - ox) < abs(ty - oy)  then
+                        ty:= max(ViewTopY + t, oy + t)
+                    else
+                        ty:= max(ViewTopY + t, ty);
+                    end;
 
                 dAngle := DxDy2Angle(int2hwfloat(ty - oy), int2hwfloat(tx - ox)) + 90;