From 5383360c38abc9729d8c9979cb9932cb5e2a7c95 Mon Sep 17 00:00:00 2001 From: Julian Winkler Date: Mon, 2 Jun 2025 20:14:09 +0200 Subject: [PATCH] Canvas: implement another overload of drawRoundRect() --- src/api-impl/android/graphics/Canvas.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/api-impl/android/graphics/Canvas.java b/src/api-impl/android/graphics/Canvas.java index 82e96b98..81dcb97d 100644 --- a/src/api-impl/android/graphics/Canvas.java +++ b/src/api-impl/android/graphics/Canvas.java @@ -416,13 +416,20 @@ public class Canvas { gsk_canvas.restoreToCount(count); } - public void drawRoundRect(RectF rect, float rx, float ry, Paint paint) { + public void drawRoundRect(float left, float top, float right, float bottom, float rx, float ry, Paint paint) { if (paint.getShader() instanceof BitmapShader) { BitmapShader shader = (BitmapShader)paint.getShader(); drawBitmap(shader.bitmap, 0, 0, paint); + } else { + gsk_canvas.snapshot = bitmap.getSnapshot(); + gsk_canvas.drawRoundRect(left, top, right, bottom, rx, ry, paint); } } + public void drawRoundRect(RectF rect, float rx, float ry, Paint paint) { + drawRoundRect(rect.left, rect.top, rect.right, rect.bottom, rx, ry, paint); + } + public void getMatrix(Matrix matrix) { matrix.reset(); } @@ -518,10 +525,6 @@ public class Canvas { Log.w("Canvas", "STUB: drawArc"); } - public void drawRoundRect(float left, float top, float right, float bottom, float rx, float ry, Paint paint) { - Log.w("Canvas", "STUB: drawRoundRect"); - } - public boolean getClipBounds(Rect outRect) { /* UGLY HACK */ outRect.set(0, 0, Resources.getSystem().getDisplayMetrics().widthPixels, Resources.getSystem().getDisplayMetrics().heightPixels);