godotengine / godotengine/godot
Texture Progress with offset fill doesn't properly draw with nine patch stretch
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Tested in v4.3.stable.official [77dcf97d8]
### System information
Windows 10, Forward+ Renderer
### Issue description
Texture progress is supposed to use a fill texture that only fills in the drawn progress inside of an Over or Under dressing texture.
When using it in this way for a texture that needs to be able to be shrunk (necessitating clicking Nine Patch Stretch) - the fill does not draw in the correct UV space, nor properly handling the appropriate texture offset.

Seen here: clicking on NinePatchStretch has made this smaller texture - that's supposed to be the size of the empty space inside the Over texture - the entire size of the TextureProgress. It is also still using the original texture offset, not adjusting relatively to the drawn space of the node.
### Steps to reproduce
In a new project - create a TextureProgress node
Use either the supplied textures or any texture that requires an offset Progress texture that is a different size than the original
Apply the larger texture to the Over (the right image)
Apply the smaller texture to the Progress (the left image)
set the value of the TextureProgress node to 100 to see the progress draw
Enable NinePatchStretch -> observe the smaller Progress texture become the size of the entire rect.
### Minimal reproduction project (MRP)
[textureprogressbug.zip](https://github.com/user-attachments/files/16738516/textureprogressbug.zip)
Contributor guide
Research direction
Start by reproducing the issue with the linked textureprogressbug.zip project in Godot v4.3.stable, using a TextureProgress node with different Over and Progress textures and NinePatchStretch enabled. Inspect the TextureProgress rendering path and compare the fill texture's UV space and offset with the node's drawn rectangle. Done means the progress texture remains correctly sized and positioned inside the Over texture when NinePatchStretch is enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100