#PB_Canvas_MouseX showing wrong position?
Posted: Tue Jan 08, 2013 12:06 pm
Edited to show more clearly the problem.
On this example seems that GetGadgetAttribute(0, #PB_Canvas_MouseX) shows a position
displaced a few pixels to the left of the mouse pointer.
Is my fault or a bug?
Tested on Win7 32 and 64
On this example seems that GetGadgetAttribute(0, #PB_Canvas_MouseX) shows a position
displaced a few pixels to the left of the mouse pointer.
Is my fault or a bug?
Tested on Win7 32 and 64
Code: Select all
If OpenWindow(0, 0, 0, 220, 220, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ScrollAreaGadget(1,0,0,220,220,400,220,10)
CanvasGadget(0, 10, 10, 200, 200)
CloseGadgetList()
StartDrawing(CanvasOutput(0))
Box (50,10,10,50,#Red)
StopDrawing()
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Gadget And EventGadget() = 0
If eventType() = #PB_EventType_MouseMove
If StartDrawing(CanvasOutput(0))
X = GetGadgetAttribute(0, #PB_Canvas_MouseX)
Y = GetGadgetAttribute(0, #PB_Canvas_MouseY)
SetWindowTitle(0,Str(X)+" "+Str(Y))
StopDrawing()
EndIf
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
EndIf