I found that, when using PTCgraph and setting a viewport with anything other than x1 = 0 and y1=0 that the ptcmouse unit does not adjust its mousex, mousey for the possible viewport offset. I'd have to rebuild ptcmouse and even though I made a change to the pctmouse unit, the changes aren't reflected.
Ptcmouse has the following code:
procedure GetMouseState(var x, y, buttons: LongInt);
begin
GetMouseEvents;
x := MouseX;
y := MouseY;
buttons := MouseButtonState;
end;
and I want to rebuild it as:
procedure GetMouseState(var x, y, buttons: LongInt);
var
v:viewsettings;
begin
GetMouseEvents;
getviewsettings(v);
x := MouseX-v.x1;
y := MouseY-v.y1;
buttons := MouseButtonState;
end;
I could just save the ptcgraph unit code as a my_mouse unit, make my change and use it instead of ptcmouse.
So how can I rebuild pctmouse to reflect my change to its getmousestate procedure? Or is it better just to do my workaround? (Which I started to do already).