Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add roundRect #828

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api-reports/2_12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ CanvasRenderingContext2D[JC] def quadraticCurveTo(cpx: Double, cpy: Double, x: D
CanvasRenderingContext2D[JC] def rect(x: Double, y: Double, w: Double, h: Double): Unit
CanvasRenderingContext2D[JC] def restore(): Unit
CanvasRenderingContext2D[JC] def rotate(angle: Double): Unit
CanvasRenderingContext2D[JC] def roundRect(x: Double, y: Double, w: Double, h: Double, radii: js.Any): Unit
CanvasRenderingContext2D[JC] def save(): Unit
CanvasRenderingContext2D[JC] def scale(x: Double, y: Double): Unit
CanvasRenderingContext2D[JC] def setLineDash(segments: js.Array[Double]): Unit
Expand Down
1 change: 1 addition & 0 deletions api-reports/2_13.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ CanvasRenderingContext2D[JC] def quadraticCurveTo(cpx: Double, cpy: Double, x: D
CanvasRenderingContext2D[JC] def rect(x: Double, y: Double, w: Double, h: Double): Unit
CanvasRenderingContext2D[JC] def restore(): Unit
CanvasRenderingContext2D[JC] def rotate(angle: Double): Unit
CanvasRenderingContext2D[JC] def roundRect(x: Double, y: Double, w: Double, h: Double, radii: js.Any): Unit
CanvasRenderingContext2D[JC] def save(): Unit
CanvasRenderingContext2D[JC] def scale(x: Double, y: Double): Unit
CanvasRenderingContext2D[JC] def setLineDash(segments: js.Array[Double]): Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ class CanvasRenderingContext2D extends js.Object {
/** Creates a path for a rectangle at position (x, y) with a size that is determined by width and height. */
def rect(x: Double, y: Double, w: Double, h: Double): Unit = js.native

/** Creates a path for a rounded rectangle with a specified position, width, height, and corner radii. */
def roundRect(x: Double, y: Double, w: Double, h: Double, radii: js.Any): Unit = js.native
Comment on lines +172 to +173
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Instead of js.Any can we add several overloads of this method for the various types of radii?


/** Creates a clipping path from the current sub-paths. Everything drawn after clip() is called appears inside the
* clipping path only. For an example, see Clipping paths in the Canvas tutorial.
*/
Expand Down
Loading