Page 1 of 1

CanvasVectorOutput & Unit

Posted: Sun Dec 18, 2022 7:05 am
by useful

Code: Select all

OpenWindow(0, 0, 0, 400, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 400, 200) 
   
StartVectorDrawing(CanvasVectorOutput(0, #PB_Unit_Inch))
Debug ConvertCoordinateX(399, 199, #PB_Coordinate_Device, #PB_Coordinate_User)
Debug VectorOutputWidth()
Debug ConvertCoordinateY(399, 199, #PB_Coordinate_Device, #PB_Coordinate_User)
Debug VectorOutputHeight()
StopVectorDrawing()
StartVectorDrawing(CanvasVectorOutput(0, #PB_Unit_Millimeter))
Debug ConvertCoordinateX(399, 199, #PB_Coordinate_Device, #PB_Coordinate_User)
Debug VectorOutputWidth()
Debug ConvertCoordinateY(399, 199, #PB_Coordinate_Device, #PB_Coordinate_User)
Debug VectorOutputHeight()
StopVectorDrawing()
StartVectorDrawing(CanvasVectorOutput(0, #PB_Unit_Point))
Debug ConvertCoordinateX(399, 199, #PB_Coordinate_Device, #PB_Coordinate_User)
Debug VectorOutputWidth()
Debug ConvertCoordinateY(399, 199, #PB_Coordinate_Device, #PB_Coordinate_User)
Debug VectorOutputHeight()
StopVectorDrawing()
  
;Repeat : Event = WaitWindowEvent() : Until Event = #PB_Event_CloseWindow
PB -->
4.1562495231628418
4.166666666666667
2.0729165077209473
2.0833333333333335
105.56874084472656
105.83333333333333
52.652080535888672
52.916666666666664
299.24996948242187
300.0
149.24998474121094
150.0

SB -->
399
400
199
200
399
400
199
200
399
400
199
200
Is it a compiler error or incorrect documentation?
p.s.
I had plans to identify the device by screen size in millimeters.
It was a fiasco.

Re: CanvasVectorOutput & Unit

Posted: Tue Dec 20, 2022 1:35 am
by useful
Do I understand correctly that
#PB_Unit_Point
#PB_Unit_Inch
#PB_Unit_Millimeter
in SpiderBasic is not supported and you need to correct the documentation?

Or is this a bug?

Re: CanvasVectorOutput & Unit

Posted: Fri Dec 23, 2022 8:15 am
by useful
Am I the only one who cares about this?

Re: CanvasVectorOutput & Unit

Posted: Sat Dec 24, 2022 11:00 am
by plouf
welll vector drawing is not very popular , but we all want this fixed because sometime will needed :)

seems like a bug since Debug VectorUnit(), return correct unit is being set each time