Fixed rounded corners on RenderScope 1.21.6 #59

This commit is contained in:
2026-03-25 21:46:34 +01:00
parent 51c6108e35
commit 4f44274111
2 changed files with 12 additions and 15 deletions
@@ -32,7 +32,7 @@ public class Matrix3x2fStackRef implements MatrixStackRef {
@Override @Override
public void rotate(float angle) { public void rotate(float angle) {
stack.rotate(angle); stack.rotate((float) Math.toRadians(angle));
} }
@Override @Override
@@ -172,9 +172,8 @@ public class RenderScopeImpl implements RenderScope {
matrices.pop(); matrices.pop();
matrices.push(); matrices.push();
matrices.translate(cornerWidth, cornerHeight * 2); matrices.rotate(-90);
matrices.stack.rotate((float) Math.toRadians(90)); matrices.translate(-cornerHeight * 2, 0);
matrices.translate(0, -cornerWidth);
matrices.scale(0.05f, 0.05f); matrices.scale(0.05f, 0.05f);
drawRoundedCorner(cornerHeight, cornerWidth, radius * 10, color); drawRoundedCorner(cornerHeight, cornerWidth, radius * 10, color);
matrices.pop(); matrices.pop();
@@ -186,19 +185,17 @@ public class RenderScopeImpl implements RenderScope {
return; return;
radius = Math.min(radius, Math.min(width, height)); radius = Math.min(radius, Math.min(width, height));
fill(x, y, x + width, y + height, color); int cornerWidth = width / 2;
int cornerHeight = height / 2;
// int cornerWidth = width / 2; matrices.push();
// int cornerHeight = height / 2; matrices.translate(x, y);
drawRoundedSide(cornerWidth, cornerHeight, radius, color);
// matrices.push(); matrices.translate(cornerWidth * 2, cornerHeight * 2);
// matrices.translate(x, y); matrices.rotate(180);
// drawRoundedSide(cornerWidth, cornerHeight, radius, color); drawRoundedSide(cornerWidth, cornerHeight, radius, color);
matrices.pop();
// matrices.translate(cornerWidth * 2, cornerHeight * 2);
// matrices.stack.rotate((float) Math.toRadians(90));
// drawRoundedSide(cornerWidth, cornerHeight, radius, color);
// matrices.pop();
} }
@Override @Override