Weird pixel shifting issue with subviewport

Godot Version

4.4.stable - MacOS

I have a scene called ActionBar.tscn - The scene is basically composed by a background sprite 2d, and 10 other Sprite2D that sits on top of this background sprite and 6 TextureButton also sitting on top of this background sprite.

Everything looks perfect.

I have another scene, called Hud.tscn the scene root node is a SubviewportContainer, followed by a Subviewport as child.

As soon as I drag the ActionBar.tscn as a child of the subviewport it seems the 16 sprites I mentioned from ActionBar.tscn shift 1pixel to the right as the screenshot shows.

Please find the screenshots attached, but here’s what I did so far:

  • All Sprite2D and TextureButton nodes in ActionBar.tscn have integer positions;
  • All Sprite2D and TextureButton sizes are integers

On the subviewport:

  • It’s size matches exactly the project settings viewport (so no distortion or weird stretch)
  • No scaling applied.
  • Positioned properly.

Also project is configured to snap to pixel grid.

This is the ActionBar scene

And this is how it looks as soon as I drag the ActionBar.tscn as a child of the subviewport

I don’t know what else I can do to get it right. Any help is appreciated.

Thanks!

Uhm, that’s weird. You could try disabling Viewport.gui_snap_controls_to_pixels in the SubViewport