Plot vs Box

Just starting out? Need help? Post your questions and find answers here.
AZJIO
Addict
Addict
Posts: 2223
Joined: Sun May 14, 2017 1:48 am

Plot vs Box

Post 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
User avatar
STARGÅTE
Addict
Addict
Posts: 2259
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Plot vs Box

Post 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().
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Post Reply