I'm getting some unwanted stretching along the corners. I was specifically trying to use style box textures on a button, but they seem to work the same as NinePatchRects, and upon testing I got the same result.

Lengthening the shape in the x axis seems to not cause corner stretching, but when altering the shape along the y axis beyond the default height corners start to stretch and distort instead of maintaining their aspect ratio.

I'm using Godot 3.5.1, and had the issue with 3.5.0 as well. Has anyone else had this problem and know any solutions? Or know if it's being fixed/changed?




(edited for clarity)

  • Megalomaniak replied to this.
  • Megalomaniak

    I think I actually found the solution to my problem! Turns out it's not broken, but there is a setting in project settings (rendering->2D) that I didn't know about that sets the NinePatchRect's stretch mode. There's a fixed option and a scaling option and it was set to scaling. I set it to fixed and it seems to be working now.

    Megalomaniak

    As in it doesn't stretch or distort the corners. The sides stretching is not a problem.

    Ah, I see, at first I thought you meant the whole node. Which made little sense. Yeah, I'd expect the corners to keep their aspect ratio 1:1. If you provide a minimal reproduction project then perhaps others can (easily) test it out and if confirmed this should perhaps be reported to the issue tracker as a bug.

      a month later

      Megalomaniak

      I think I actually found the solution to my problem! Turns out it's not broken, but there is a setting in project settings (rendering->2D) that I didn't know about that sets the NinePatchRect's stretch mode. There's a fixed option and a scaling option and it was set to scaling. I set it to fixed and it seems to be working now.