PtInRegion crashes on MAC OS

Issue #195 resolved
Harry Stahl created an issue

function MouseInRect(x,y, x1,y1, x2,y2: Integer): Boolean; var rh: THandle; begin rh := CreateRectRgn(x1-1,y1-1,x2+1,y2+1); Result := PtInRegion(rh,x,y); // Here it crashes on MAC (SigAbort (6)) DeleteObject(rh); end;

Call this function with values (eg 15, 250, 10,10, 100, 200), it will crash on MAC OS (linux is ok)

But on linux it gives back not the right result, when x and y is in the rect.

As workaround one can use in the case for this function (mouseinRect at all) to PtInRect

Comments (3)

  1. Log in to comment