Works fine here, tested on Windows 10 (x64):
Code: Select all
EnableExplicit
Procedure.i Main()
Protected.i exit,angle,mx,my
If OpenWindow(0,0,0,256,256,"Rotation-Test",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
If CanvasGadget(0,0,0,WindowWidth(0),WindowHeight(0))
Repeat
Repeat
Select WindowEvent()
Case #PB_Event_CloseWindow
exit = #True
Case #PB_Event_None
Break
EndSelect
ForEver
If StartVectorDrawing(CanvasVectorOutput(0))
VectorSourceColor(RGBA(0,0,0,255))
FillVectorOutput()
If WindowMouseX(0) <> -1
mx = WindowMouseX(0)
my = WindowMouseY(0)
EndIf
TranslateCoordinates(mx - 128,my - 128)
RotateCoordinates(128,128,angle)
VectorSourceColor(RGBA(100,200,100,255))
AddPathCircle(128,128,4)
MovePathCursor(64,64)
AddPathLine(192,192)
StrokePath(2)
VectorSourceColor(RGBA(200,100,100,255))
AddPathCircle(64,64,10)
AddPathCircle(192,192,10)
FillPath()
StopVectorDrawing()
EndIf
angle + 1
Delay(20)
Until exit
EndIf
CloseWindow(0)
EndIf
ProcedureReturn #Null
EndProcedure
End Main()
Fix for the other code:
Code: Select all
If OpenWindow(0, 0, 0, 400, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 400, 200)
Repeat
Event = WaitWindowEvent(10)
If StartVectorDrawing(CanvasVectorOutput(0))
VectorSourceColor(RGBA(200, 50, 100, 255))
FillVectorOutput()
VectorSourceColor(RGBA(0, 255, 0, 255))
TranslateCoordinates(10, 10)
RotateCoordinates(40,0, i)
MovePathCursor(0,0)
AddPathLine(80, 0, 0)
StrokePath(4)
StopVectorDrawing()
i + 1
EndIf
Until Event = #PB_Event_CloseWindow
EndIf