Page 1 of 1

SB changes gadget X/Y coordinates when size gets smaller

Posted: Sat Sep 26, 2020 11:51 am
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

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

Posted: Mon Oct 05, 2020 6:30 pm
by Fred
Fixed the overflow. The gadget moving when very small seems a browser thing to me...