Drawing on more than one canvas

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

Drawing on more than one canvas

Post by William Van Hoecke »

It seems to be impossible to draw on more than one canvas.
Same code works fine in Purebasic but fails on Spiderbasic

Code: Select all

If OpenWindow(0, 0, 0, 1000, 700, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  CanvasGadget(100, 10, 10, 300, 680,#PB_Canvas_Border)
  SetGadgetColor(100,#PB_Gadget_BackColor,RGB(120,120,120))
  
  CanvasGadget(101, 320, 10, 300, 680,#PB_Canvas_Border)
  SetGadgetColor(101,#PB_Gadget_BackColor,RGB(120,120,120))
  
  CanvasGadget(102, 630, 10, 300, 680,#PB_Canvas_Border)
  SetGadgetColor(102,#PB_Gadget_BackColor,RGB(120,120,120))
    
  For tmp = 100 To 102
    progress.i + 10
    If StartVectorDrawing(CanvasVectorOutput(tmp))
      ScaleCoordinates(0.7,0.7)
      RotateCoordinates(40,50,progress)
      
      AddPathSegments("M 40 50,l 100 0")
      AddPathSegments("M 40 100,l 100 0")
      AddPathSegments("M 40 150,l 100 0")
      AddPathSegments("M 140 50,m 23 -18,l 3 3,l 4 -7,Z")
      AddPathSegments("M 140 50,m 23 18,l 3 -3,l 4 7,Z")
      
      VectorSourceColor(RGBA(0, 0, 255, 255))
      StrokePath(1,#PB_Path_RoundCorner)
      
      AddPathCircle(140,50,15)
      VectorSourceColor(RGBA(255, 0, 0, 255))
      StrokePath(5) ;, #PB_Path_RoundCorner
      
      StopVectorDrawing()
    EndIf
  Next TMP  
EndIf