diff options
| author | kleonc <9283098+kleonc@users.noreply.github.com> | 2024-08-29 15:34:30 +0200 |
|---|---|---|
| committer | kleonc <9283098+kleonc@users.noreply.github.com> | 2024-08-29 15:34:30 +0200 |
| commit | 86c773d208afee2b37d3c2f595f4e7d24c78e2cb (patch) | |
| tree | 6609c3ff79ddaa1f03e8e7aaf3efd69810c6ed14 | |
| parent | 40b378e9e2338d84f897f6991cc913a713295785 (diff) | |
| download | redot-engine-86c773d208afee2b37d3c2f595f4e7d24c78e2cb.tar.gz | |
Fix StyleBoxFlat rectangles skewing independently
| -rw-r--r-- | scene/resources/style_box_flat.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/resources/style_box_flat.cpp b/scene/resources/style_box_flat.cpp index 52d02e92cb..60b91ef0cb 100644 --- a/scene/resources/style_box_flat.cpp +++ b/scene/resources/style_box_flat.cpp @@ -300,8 +300,8 @@ inline void draw_rounded_rectangle(Vector<Vector2> &verts, Vector<int> &indices, const real_t x = radius * (real_t)cos((corner_index + detail / (double)adapted_corner_detail) * (Math_TAU / 4.0) + Math_PI) + corner_point.x; const real_t y = radius * (real_t)sin((corner_index + detail / (double)adapted_corner_detail) * (Math_TAU / 4.0) + Math_PI) + corner_point.y; - const float x_skew = -skew.x * (y - ring_rect.get_center().y); - const float y_skew = -skew.y * (x - ring_rect.get_center().x); + const float x_skew = -skew.x * (y - style_rect.get_center().y); + const float y_skew = -skew.y * (x - style_rect.get_center().x); verts.push_back(Vector2(x + x_skew, y + y_skew)); colors.push_back(color); } |
