[Done] PB 6.20 B3 PathCursor after RotateCoordinates

Post bugreports for the Windows version here
Justin
Addict
Addict
Posts: 956
Joined: Sat Apr 26, 2003 2:49 pm

[Done] PB 6.20 B3 PathCursor after RotateCoordinates

Post 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
freak
PureBasic Team
PureBasic Team
Posts: 5946
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: [Done] PB 6.20 B3 PathCursor after RotateCoordinates

Post 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.
quidquid Latine dictum sit altum videtur
freak
PureBasic Team
PureBasic Team
Posts: 5946
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: [Done] PB 6.20 B3 PathCursor after RotateCoordinates

Post 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.
quidquid Latine dictum sit altum videtur
Post Reply