diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-02-16 22:26:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-16 22:26:06 +0100 |
commit | a034cac583dc0d711f3dfe056516d77f2ef62d7c (patch) | |
tree | 3d347c0efc8d2a5e1691ccc30732cc9fa547a75c /scene | |
parent | 44d24e8b78e73448f586ef8e9138d3e15d2ab7e4 (diff) | |
parent | 1974f6995f6942b09dd4eea4e20585c6d9aad646 (diff) |
Merge pull request #25953 from nekomatata/fix-radial-texture-progress
Fixed TextureProgress in Radial Mode when using center offset
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/texture_progress.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp index 778d86d546..bf6a5d30bf 100644 --- a/scene/gui/texture_progress.cpp +++ b/scene/gui/texture_progress.cpp @@ -160,23 +160,27 @@ Point2 TextureProgress::unit_val_to_uv(float val) { if (edge == 0) { if (dir.x > 0) continue; - cp = -dir.x; cq = -(edgeLeft - p.x); + dir.x *= 2.0 * cq; + cp = -dir.x; } else if (edge == 1) { if (dir.x < 0) continue; - cp = dir.x; cq = (edgeRight - p.x); + dir.x *= 2.0 * cq; + cp = dir.x; } else if (edge == 2) { if (dir.y > 0) continue; - cp = -dir.y; cq = -(edgeBottom - p.y); + dir.y *= 2.0 * cq; + cp = -dir.y; } else if (edge == 3) { if (dir.y < 0) continue; - cp = dir.y; cq = (edgeTop - p.y); + dir.y *= 2.0 * cq; + cp = dir.y; } cr = cq / cp; if (cr >= 0 && cr < t1) |