Page 1 of 1

AddPathText() and DrawVectorText() don't move cursor

Posted: Tue Jan 23, 2018 5:55 pm
by #NULL
the documentation says AddPathText() and DrawVectorText() move the cursor but they don't.
AddPathText() wrote:After the call to this function the cursor is moved to the end of the added text.
DrawVectorText() wrote:The cursor will be moved horizontally to the end of the drawn text.
DrawVectorParagraph() does't not move the cursor either but the documentation does not state that.

PureBasic 5.62 beta 1 (Linux - x64)

Code: Select all

If OpenWindow(0, 0, 0, 400, 600, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  CanvasGadget(0, 0, 0, 400, 600)
  LoadFont(0, "monospace", 20, #PB_Font_Bold)
  
  If StartVectorDrawing(CanvasVectorOutput(0))
      VectorFont(FontID(0), 20)
      
      MovePathCursor(50, 125)
      
      AddPathText("abcdefg")
      Debug "PathCursor: " + PathCursorX() + ", " + PathCursorY()
      
      AddPathText("_______")
      Debug "PathCursor: " + PathCursorX() + ", " + PathCursorY()
      
      VectorSourceColor(RGBA(0, 0, 0, 100))
      FillPath()
      
      MovePathCursor(50, 225)
      DrawVectorText("abcdefg")
      Debug "PathCursor: " + PathCursorX() + ", " + PathCursorY()
      DrawVectorText("_______")
      Debug "PathCursor: " + PathCursorX() + ", " + PathCursorY()
      
      MovePathCursor(50, 325)
      Debug "PathCursor: " + PathCursorX() + ", " + PathCursorY()
      DrawVectorParagraph("abcdefg", 50, 50)
      Debug "PathCursor: " + PathCursorX() + ", " + PathCursorY()
      DrawVectorParagraph("_______", 50, 50)
      
    StopVectorDrawing()
  EndIf
  
  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow
EndIf

Re: AddPathText() and DrawVectorText() don't move cursor

Posted: Tue Feb 06, 2018 10:22 pm
by Andre
Need to be checked by Fred/freak, if this is intended behaviour (and the Docs need to be adapted) or if there is a bug / missing functionality at the PB commands...