Popup menu items misaligned after zoom

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Svajoklis

I have been developing a card game and wanted to create menus styled after Windows 98. I have created the separators, the menu items, panels, all the stuff. and it all seems to work out fine when not zoomed in. After resizing the viewport and setting screen stretch the menu items overflow the container.

func set_window_size(size):
var tree = get_tree()
var viewport = tree.root

var scaled_size = size * scale_value

if !OS.window_fullscreen:
	OS.window_size = scaled_size

tree.set_screen_stretch(SceneTree.STRETCH_MODE_2D, SceneTree.STRETCH_ASPECT_KEEP, size)

viewport.size = scaled_size

prev_size = size

Looks fine here:
Looks fine

Overflows when zoomed in:
Overflows

Did anyone else have this problem? Couldn’t find it by searching S: Thanks!