more failing vector graphics

Found an issue in SpiderBasic ? Please report it here !
User avatar
William Van Hoecke
Posts: 39
Joined: Tue Oct 22, 2019 12:09 pm

more failing vector graphics

Post by William Van Hoecke »

Demonstration on how ABSOLUTE move in pathsegments fails
As result existing complex SVG graphics will show completely wrong

Code: Select all

Enumeration
  #FONT_BOLD
  #FONT_NORMAL
  #WINDOW
  #CANVAS
EndEnumeration  
LoadFont(#FONT_BOLD, "Consolas", 10,#PB_Font_Bold)
LoadFont(#FONT_NORMAL, "Consolas", 10)
    ;RotateCoordinates(2521,189,90)
    ;ScaleCoordinates(0.33,0.33)
    ;2980/2107
OpenWindow(#WINDOW,0,0,1003,712,"TEST",#PB_Window_BorderLess)
  CanvasGadget(#CANVAS,5,5,993,702,#PB_Canvas_Border)
  StartVectorDrawing(CanvasVectorOutput(#CANVAS))
    AddPathSegments("M 40 20 L 120 20 L 120 60 L 200 60 L 200 100 L 280 100 L 280 140 L 360 140 L 360 180")
    VectorSourceColor(RGBA(255, 0, 0, 255))
    StrokePath(25, #PB_Path_RoundCorner)
    
    AddPathSegments("M 40 20 l 80 0 l 0 40 l 80 0 l 0 40 l 80 0 l 0 40 l 80 0 l 0 40")
    VectorSourceColor(RGBA(0,255, 0, 255))
    StrokePath(15, #PB_Path_RoundCorner)
    
    AddPathSegments("M 360 180 m -80 -40 l 80 0 l 0 40 M 280 100 l 0 40 l 80 0 M 200 60 l 0 40 l 80 0 M 120 20 l 0 40 l 80 0 M 40 20 l 80 0")
    VectorSourceColor(RGBA(0, 0, 255, 255))
    StrokePath(5, #PB_Path_RoundCorner)
    
  StopVectorDrawing()
Above code works fine in PureBasic