equal
deleted
inserted
replaced
147 d:= DistanceI(mp.x - leftX - mapBorderMargin, mp.y - iy).Round; |
147 d:= DistanceI(mp.x - leftX - mapBorderMargin, mp.y - iy).Round; |
148 t1:= a * (mp.x - mapBorderMargin) + b * (mp.y - iy); |
148 t1:= a * (mp.x - mapBorderMargin) + b * (mp.y - iy); |
149 if t1 > 0 then distL:= d else distR:= d; |
149 if t1 > 0 then distL:= d else distR:= d; |
150 |
150 |
151 // right border |
151 // right border |
152 iy:= (rightX - mapBorderMargin - mp.x) * b div a + mp.y; |
152 iy:= (LongInt(rightX) - mapBorderMargin - mp.x) * b div a + mp.y; |
153 d:= DistanceI(mp.x - rightX + mapBorderMargin, mp.y - iy).Round; |
153 d:= DistanceI(mp.x - rightX + mapBorderMargin, mp.y - iy).Round; |
154 if t1 > 0 then distR:= d else distL:= d; |
154 if t1 > 0 then distR:= d else distL:= d; |
155 end else |
155 end else |
156 begin |
156 begin |
157 distL:= LAND_WIDTH + LAND_HEIGHT; |
157 distL:= LAND_WIDTH + LAND_HEIGHT; |