Using #PB_Path_Connected in VectorDraw

Just starting out? Need help? Post your questions and find answers here.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Using #PB_Path_Connected in VectorDraw

Post by davido »

Joining lines to arcs with #PB_Path_Connected, produces very neat corners.
I wished to do the same with two arcs.
Is this possible?
The manual seems to indicate that it only works with lines and circles.
Can anyone help, please?

I've included my test which the first part does not work.
The second part seems to indicate some anomaly with #PB_Path_Connected, maybe.

Code: Select all

  If OpenWindow(0, 0, 0, 800, 600, "#PB_Path_Connected, tests", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    CanvasGadget(0, 0, 0, 800, 600)

    If StartVectorDrawing(CanvasVectorOutput(0))
      ;<> Make a continuous path from arc1 to arc2
      ;   Appears to get the join wrong and produces a spurious line beneath
      VectorSourceColor($ff0000ff)
      AddPathCircle(200, 200, 100,180,0)
      AddPathCircle(250, 200, 50, 0, 180, #PB_Path_CounterClockwise | #PB_Path_Connected)
      StrokePath(10)
      
      ;<> StrokePath() should start a new path, yet the new arc is joint to the path above.
      ;   Note that the join of the two arcs on the right is correct.
      ;   I would prefer the neater join made by a connect path.
      AddPathCircle(400, 200, 100,180,0)
      AddPathCircle(450, 200, 50, 0, 180, #PB_Path_CounterClockwise)
      StrokePath(10)
      StopVectorDrawing()
    EndIf
    
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
  EndIf
DE AA EB
Oma
Enthusiast
Enthusiast
Posts: 312
Joined: Thu Jun 26, 2014 9:17 am
Location: Germany

Re: Using #PB_Path_Connected in VectorDraw

Post by Oma »

Hello davido!
Since I didn't understand and saw the problem on linux, i've tried the code on XP. It's again an vector library issue on Windows and works on Linux as expected.

Best regards, Charly
PureBasic 5.4-5.7, Linux: (X/L/K)Ubuntus+Mint - Windows XP (32Bit)
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Using #PB_Path_Connected in VectorDraw

Post by davido »

Hi Charly,

Thank you, very much.

Edit: 20160526 10:00AM
For some reason I assumed this problem also occurred on my MacBook.
However, having just re-checked I found, just as you did, it worked perfectly.
Naturally I feel most embarrassed about this. My apologies for putting you to so much trouble.
So the problem only exists on Windows.

Regards,
Dave

Can a Moderator please move it to the Windows 'Bugs' section.
DE AA EB
Post Reply