Page 1 of 1

[Done] PB 6.20 B3 PathCursor after RotateCoordinates

Posted: Fri Jan 24, 2025 5:58 pm
by Justin
Shouldn' t PathCursor return 0?
W10 64

Code: Select all

If OpenWindow(0, 0, 0, 400, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    CanvasGadget(0, 0, 0, 400, 200)
		       
    If StartVectorDrawing(CanvasVectorOutput(0))
			RotateCoordinates(20, 20, 20)
			;Shouldn't be zero?
			Debug PathCursorX()
			Debug PathCursorY()

      StopVectorDrawing()
    EndIf
    
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
  EndIf

Re: [Done] PB 6.20 B3 PathCursor after RotateCoordinates

Posted: Sun Sep 14, 2025 8:21 pm
by freak
This is the expected behavior.

Rotating the coordinate system only affects commands after it. The cursor location remained unchanged by it. However, when you call PathPointX() after, you get the coordinates of the OLD (0, 0) expressed in the new, rotated coordinate system. That is why the result is not (0, 0) anymore.

Re: [Done] PB 6.20 B3 PathCursor after RotateCoordinates

Posted: Sun Sep 14, 2025 9:42 pm
by freak
Ok, so there is a difference with the other OS:
  • If you have not done anything with the path yet, coordinate transformations do not affect the start point and it stays at (0, 0)
  • If you used any path command, the last cursor position is affected by the transformation
I have changed it to work the same way on Windows.

Fixed.