SB changes gadget X/Y coordinates when size gets smaller

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kurzer
Posts: 90
Joined: Mon May 26, 2014 9:33 am

SB changes gadget X/Y coordinates when size gets smaller

Post by Kurzer »

If a gadget becomes so small that its text does not fit into the gedget, SpiderBasic also changes the X,Y coordinates of the gadget, although these values are not touched during a resize.

In PureBasic this phenomenon does not occur.

Image ------------ Image
SpiderBasic vs. PureBasic

This snippet demostrates the bug:

Code: Select all

Procedure WindowSized()
	ResizeGadget(1, #PB_Ignore, #PB_Ignore, #PB_Ignore, WindowHeight(0) - 60)
EndProcedure

If OpenWindow(0, 0, 0, 320, 270, "FrameGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget)
	
	ButtonGadget(0, 10, 10, 300, 38, ".")
	ButtonGadget(1, 10, 50, 300, 210, "This is a Button")
	BindEvent(#PB_Event_SizeWindow, @WindowSized())

	
	CompilerIf #PB_Compiler_OS <> #PB_OS_Web
		; In PureBasic we need an event loop
		Repeat
		Until	WaitWindowEvent() = #PB_Event_CloseWindow
	CompilerEndIf	
EndIf
Sorry for the nitpicking at my last bug reports, but I'm currently working on a x-platform pixel-perfect layout engine and these bugs are exactly the kind of things I notice.

Markus
SB 2.32 x86, Browser: Iron Portable V. 88.0.4500.0 (Chromium based), User age in 2023: 55y
"Happiness is a pet." | "Never run a changing system!"
Fred
Site Admin
Posts: 1510
Joined: Mon Feb 24, 2014 10:51 am

Re: SB changes gadget X/Y coordinates when size gets smaller

Post by Fred »

Fixed the overflow. The gadget moving when very small seems a browser thing to me...
Post Reply