Skip to content

Commit c8bb8d2

Browse files
committed
Push local matrix instead of transforming position vectors
1 parent cab9b11 commit c8bb8d2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

osu.Framework/Graphics/UserInterface/CircularProgress.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,15 @@ private void drawTriangulatedShape(IRenderer renderer)
161161
float angle = 0;
162162
bool isInnerVertex = true;
163163

164+
renderer.PushLocalMatrix(DrawInfo.Matrix);
165+
164166
for (int i = 0; i < vertex_count; i++)
165167
{
166168
Vector2 relativePos = rotateAround(isInnerVertex ? inner : outer, origin, angle);
167169

168-
vertexBatch?.AddAction(new TexturedVertex2D(renderer)
170+
vertexBatch?.Add(new TexturedVertex2D(renderer)
169171
{
170-
Position = Vector2Extensions.Transform(relativePos * drawSize, DrawInfo.Matrix),
172+
Position = relativePos * drawSize,
171173
Colour = DrawColourInfo.Colour.Interpolate(relativePos).SRGB,
172174
TextureRect = new Vector4(tRect.Left, tRect.Top, tRect.Right, tRect.Bottom),
173175
TexturePosition = new Vector2(tRect.Left + tRect.Width * relativePos.X, tRect.Top + tRect.Height * relativePos.Y)
@@ -176,6 +178,8 @@ private void drawTriangulatedShape(IRenderer renderer)
176178
angle += angle_delta;
177179
isInnerVertex = !isInnerVertex;
178180
}
181+
182+
renderer.PopLocalMatrix();
179183
}
180184

181185
private static Vector2 rotateAround(Vector2 input, Vector2 origin, float angle)

0 commit comments

Comments
 (0)