Page 1 of 1

Plot vs Box

Posted: Thu Mar 27, 2025 8:40 am
by AZJIO
If "Box" outside of CanvasGadget, there is no error.
If "Plot" outside of CanvasGadget, it gives an error.
Did an ASM code comparison and it doesn't have a coordinate check. From this, there is an assumption that the debugger only responds to "Box".

Code: Select all

If OpenWindow(0, 0, 0, 111, 111, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
	CanvasGadget(0, 0, 0, 111, 111)
	If StartDrawing(CanvasOutput(0))
		Box(112,1,1,1,$80FFFF)
; 		Plot(112,1,$80FFFF)
		StopDrawing() 
	EndIf
	Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

Re: Plot vs Box

Posted: Thu Mar 27, 2025 9:12 am
by STARGĂ…TE
As it is written in the documentation.
https://www.purebasic.com/documentation ... /plot.html
For performance reasons there are no bounds checks performed on these coordinates, the specified coordinates must be inside the current drawing area. OutputWidth() and OutputHeight() can be used to verify that. This command is also not affected by any clipping imposed by ClipOutput().