hedgewars/uTouch.pas
changeset 6698 804e9076d136
parent 6695 32de8965c62c
child 6700 e04da46ee43c
equal deleted inserted replaced
6697:4a04c02bc8c3 6698:804e9076d136
   540     else
   540     else
   541         getSecondFinger := @fingers[0];
   541         getSecondFinger := @fingers[0];
   542 end;
   542 end;
   543 
   543 
   544 function isOnRect(rect: TSDL_Rect; finger: TTouch_Data): boolean;
   544 function isOnRect(rect: TSDL_Rect; finger: TTouch_Data): boolean;
       
   545 begin
   545     isOnRect:= (finger.x > rect.x)   and
   546     isOnRect:= (finger.x > rect.x)   and
   546                (finger.x < rect.x + rect.w) and
   547                (finger.x < rect.x + rect.w) and
   547                (cScreenHeight - finger.y > rect.y) and
   548                (cScreenHeight - finger.y > rect.y) and
   548                (cScreenHeight - finger.y < rect.y + rect.h);
   549                (cScreenHeight - finger.y < rect.y + rect.h);
   549 end;
   550 end;