Skip to content

Commit

Permalink
[texel] Fix Many large corners
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielBRDeveloper committed Aug 1, 2024
1 parent 1119690 commit 0d65e34
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions texel/src/br/nullexcept/mux/core/texel/CanvasTexel.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ public void drawRoundRect(int left, int top, int right, int bottom, int radius,
@Override
public void drawRoundRect(int left, int top, int right, int bottom, int radiusLeft, int radiusTop, int radiusRight, int radiusBottom, Paint paint) {
check();

int rh = bottom-top;
int rw = right-left;

radiusLeft = Math.min(Math.min(rw/2, rh/2), radiusLeft);
radiusRight = Math.min(Math.min(rw/2, rh/2), radiusRight);
radiusTop = Math.min(Math.min(rw/2, rh/2), radiusTop);
radiusBottom = Math.min(Math.min(rw/2, rh/2), radiusBottom);

VgTexel.beginElement();
VgTexel.applyPaint(paint);
VgTexel.drawRoundedRect(left,top,right-left, bottom-top, radiusLeft, radiusTop, radiusRight, radiusBottom);
Expand Down

0 comments on commit 0d65e34

Please sign in to comment.