Skip to content

add Path2D and related methods #769

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

Merged
merged 4 commits into from
Apr 3, 2023

Conversation

buntec
Copy link
Contributor

@buntec buntec commented Mar 28, 2023

Hi there!

Before submitting a PR containing any Scala changes, please make sure you...

  • run sbt prePR
  • commit changes to api-reports

Thanks for contributing!

Copy link
Member

@armanbilge armanbilge left a comment

Choose a reason for hiding this comment

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

Thanks! Do you mind copying some scaladocs from MDN?

@@ -124,18 +142,28 @@ class CanvasRenderingContext2D extends js.Object {
/** Fills the subpaths with the current fill style. */
def fill(): Unit = js.native

def fill(path: Path2D): Unit = js.native

def fill(fillRule: String): Unit = js.native
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, this is neat!

Comment on lines +6 to +8
@js.native
@JSGlobal
class Path2D extends js.Object {
Copy link
Member

Choose a reason for hiding this comment

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

The [[Path2D]] interface of the Canvas 2D API is used to declare a path that can then be used on a [[CanvasRenderingContext2D]] object.

* clockwise).
*/
def ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double,
endAngle: Double, anticlockwise: Boolean = js.native): Unit = js.native
Copy link
Member

Choose a reason for hiding this comment

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

Seems to be called counterclockwise in the spec.

Suggested change
endAngle: Double, anticlockwise: Boolean = js.native): Unit = js.native
endAngle: Double, counterclockwise: Boolean = js.native): Unit = js.native

Comment on lines 42 to 43
def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double,
anticlockwise: Boolean): Unit = js.native
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double,
anticlockwise: Boolean): Unit = js.native
def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double,
counterclockwise: Boolean): Unit = js.native

Copy link
Member

@armanbilge armanbilge left a comment

Choose a reason for hiding this comment

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

Thanks a bunch!!

@armanbilge armanbilge merged commit d92b4ae into scala-js:main Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants