hedgewars/uGears.pas
changeset 15169 f532203c5ceb
parent 15159 fcd697bce2a8
child 15170 3cc1a79de3fd
equal deleted inserted replaced
15168:e1dbe2c9026f 15169:f532203c5ceb
  1062                     // Get flower position
  1062                     // Get flower position
  1063                     x:= hwRound(Gear^.X) - SpritesData[sprTargetBee].Width div 2;
  1063                     x:= hwRound(Gear^.X) - SpritesData[sprTargetBee].Width div 2;
  1064                     y:= hwRound(Gear^.Y) - SpritesData[sprTargetBee].Height div 2;
  1064                     y:= hwRound(Gear^.Y) - SpritesData[sprTargetBee].Height div 2;
  1065                     // Calculate offset from map boundaries and border
  1065                     // Calculate offset from map boundaries and border
  1066                     if hasBorder then
  1066                     if hasBorder then
  1067                         x:= max(min(x, RightX - SpritesData[sprTargetBee].Width) - cBorderWidth, LeftX + cBorderWidth)
  1067                         x:= max(min(x, RightX - SpritesData[sprTargetBee].Width - cBorderWidth), LeftX + cBorderWidth)
  1068                     else
  1068                     else
  1069                         x:= max(min(x, RightX - SpritesData[sprTargetBee].Width), LeftX);
  1069                         x:= max(min(x, RightX - SpritesData[sprTargetBee].Width), LeftX);
  1070                     y:= max(y, TopY);
  1070                     y:= max(y, TopY);
  1071 
  1071 
  1072                     // Place flower
  1072                     // Place flower