Skip to content

Commit

Permalink
Fix StyleBoxFlat rectangles skewing independently
Browse files Browse the repository at this point in the history
  • Loading branch information
kleonc committed Aug 29, 2024
1 parent 40b378e commit a2398bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scene/resources/style_box_flat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a2398bd

Please sign in to comment.