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
Merged
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
32 changes: 26 additions & 6 deletions api-reports/2_12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1070,25 +1070,32 @@ CacheStorage[JT] def has(cacheName: String): js.Promise[Boolean]
CacheStorage[JT] def keys(): js.Promise[js.Array[String]]
CacheStorage[JT] def `match`(request: RequestInfo, options: CacheQueryOptions?): js.Promise[js.Any]
CacheStorage[JT] def open(cacheName: String): js.Promise[Cache]
CanvasFillRule[JT]
CanvasFillRule[SO] val evenodd: CanvasFillRule
CanvasFillRule[SO] val nonzero: CanvasFillRule
CanvasGradient[JC] def addColorStop(offset: Double, color: String): Unit
CanvasPattern[JC]
CanvasProxy[JT] def setContext(context: RenderingContext): Unit
CanvasRenderingContext2D[JC] def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double): Unit
CanvasRenderingContext2D[JC] def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, anticlockwise: Boolean): Unit
CanvasRenderingContext2D[JC] def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Boolean): Unit
CanvasRenderingContext2D[JC] def arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double): Unit
CanvasRenderingContext2D[JC] def beginPath(): Unit
CanvasRenderingContext2D[JC] def bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double): Unit
CanvasRenderingContext2D[JC] var canvas: HTMLCanvasElement
CanvasRenderingContext2D[JC] def clearRect(x: Double, y: Double, w: Double, h: Double): Unit
CanvasRenderingContext2D[JC] def clip(fillRule: String?): Unit
CanvasRenderingContext2D[JC] def clip(fillRule: CanvasFillRule?): Unit
CanvasRenderingContext2D[JC] def clip(path: Path2D): Unit
CanvasRenderingContext2D[JC] def clip(path: Path2D, fillRule: CanvasFillRule): Unit
CanvasRenderingContext2D[JC] def closePath(): Unit
CanvasRenderingContext2D[JC] def createImageData(imageDataOrSw: js.Any, sh: Double?): ImageData
CanvasRenderingContext2D[JC] def createLinearGradient(x0: Double, y0: Double, x1: Double, y1: Double): CanvasGradient
CanvasRenderingContext2D[JC] def createPattern(image: HTMLElement, repetition: String): CanvasPattern
CanvasRenderingContext2D[JC] def createRadialGradient(x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double): CanvasGradient
CanvasRenderingContext2D[JC] def drawImage(image: HTMLElement, offsetX: Double, offsetY: Double, width: Double?, height: Double?, canvasOffsetX: Double?, canvasOffsetY: Double?, canvasImageWidth: Double?, canvasImageHeight: Double?): Unit
CanvasRenderingContext2D[JC] def ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, anticlockwise: Boolean?): Unit
CanvasRenderingContext2D[JC] def fill(): Unit
CanvasRenderingContext2D[JC] def ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Boolean?): Unit
CanvasRenderingContext2D[JC] def fill(fillRule: CanvasFillRule?): Unit
CanvasRenderingContext2D[JC] def fill(path: Path2D): Unit
CanvasRenderingContext2D[JC] def fill(path: Path2D, fillRule: CanvasFillRule): Unit
CanvasRenderingContext2D[JC] def fillRect(x: Double, y: Double, w: Double, h: Double): Unit
CanvasRenderingContext2D[JC] var fillStyle: js.Any
CanvasRenderingContext2D[JC] def fillText(text: String, x: Double, y: Double, maxWidth: Double?): Unit
Expand All @@ -1098,8 +1105,9 @@ CanvasRenderingContext2D[JC] def getLineDash(): js.Array[Double]
CanvasRenderingContext2D[JC] var globalAlpha: Double
CanvasRenderingContext2D[JC] var globalCompositeOperation: String
CanvasRenderingContext2D[JC] var imageSmoothingEnabled: Boolean
CanvasRenderingContext2D[JC] def isPointInPath(x: Double, y: Double): Boolean
CanvasRenderingContext2D[JC] def isPointInPath(x: Double, y: Double, fillRule: String): Boolean
CanvasRenderingContext2D[JC] def isPointInPath(path: Path2D, x: Double, y: Double): Boolean
CanvasRenderingContext2D[JC] def isPointInPath(path: Path2D, x: Double, y: Double, fillRule: CanvasFillRule): Boolean
CanvasRenderingContext2D[JC] def isPointInPath(x: Double, y: Double, fillRule: CanvasFillRule?): Boolean
CanvasRenderingContext2D[JC] var lineCap: String
CanvasRenderingContext2D[JC] var lineDashOffset: Double
CanvasRenderingContext2D[JC] var lineJoin: String
Expand All @@ -1122,6 +1130,7 @@ CanvasRenderingContext2D[JC] var shadowColor: String
CanvasRenderingContext2D[JC] var shadowOffsetX: Double
CanvasRenderingContext2D[JC] var shadowOffsetY: Double
CanvasRenderingContext2D[JC] def stroke(): Unit
CanvasRenderingContext2D[JC] def stroke(path: Path2D): Unit
CanvasRenderingContext2D[JC] def strokeRect(x: Double, y: Double, w: Double, h: Double): Unit
CanvasRenderingContext2D[JC] var strokeStyle: js.Any
CanvasRenderingContext2D[JC] def strokeText(text: String, x: Double, y: Double, maxWidth: Double?): Unit
Expand Down Expand Up @@ -16627,6 +16636,17 @@ ParentNode[JT] def children: HTMLCollection[Element]
ParentNode[JT] def firstElementChild: Element
ParentNode[JT] def lastElementChild: Element
ParentNode[JT] def replaceChildren(nodes: Node | String*): Unit
Path2D[JC] def addPath(path: Path2D): Unit
Path2D[JC] def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double): Unit
Path2D[JC] def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Boolean): Unit
Path2D[JC] def arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double): Unit
Path2D[JC] def bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double): Unit
Path2D[JC] def closePath(): Unit
Path2D[JC] def ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Boolean?): Unit
Path2D[JC] def lineTo(x: Double, y: Double): Unit
Path2D[JC] def moveTo(x: Double, y: Double): Unit
Path2D[JC] def quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double): Unit
Path2D[JC] def rect(x: Double, y: Double, w: Double, h: Double): Unit
Pbkdf2Params[JT] val hash: HashAlgorithmIdentifier
Pbkdf2Params[JT] val iterations: Double
Pbkdf2Params[JT] val name: String
Expand Down
32 changes: 26 additions & 6 deletions api-reports/2_13.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1070,25 +1070,32 @@ CacheStorage[JT] def has(cacheName: String): js.Promise[Boolean]
CacheStorage[JT] def keys(): js.Promise[js.Array[String]]
CacheStorage[JT] def `match`(request: RequestInfo, options: CacheQueryOptions?): js.Promise[js.Any]
CacheStorage[JT] def open(cacheName: String): js.Promise[Cache]
CanvasFillRule[JT]
CanvasFillRule[SO] val evenodd: CanvasFillRule
CanvasFillRule[SO] val nonzero: CanvasFillRule
CanvasGradient[JC] def addColorStop(offset: Double, color: String): Unit
CanvasPattern[JC]
CanvasProxy[JT] def setContext(context: RenderingContext): Unit
CanvasRenderingContext2D[JC] def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double): Unit
CanvasRenderingContext2D[JC] def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, anticlockwise: Boolean): Unit
CanvasRenderingContext2D[JC] def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Boolean): Unit
CanvasRenderingContext2D[JC] def arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double): Unit
CanvasRenderingContext2D[JC] def beginPath(): Unit
CanvasRenderingContext2D[JC] def bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double): Unit
CanvasRenderingContext2D[JC] var canvas: HTMLCanvasElement
CanvasRenderingContext2D[JC] def clearRect(x: Double, y: Double, w: Double, h: Double): Unit
CanvasRenderingContext2D[JC] def clip(fillRule: String?): Unit
CanvasRenderingContext2D[JC] def clip(fillRule: CanvasFillRule?): Unit
CanvasRenderingContext2D[JC] def clip(path: Path2D): Unit
CanvasRenderingContext2D[JC] def clip(path: Path2D, fillRule: CanvasFillRule): Unit
CanvasRenderingContext2D[JC] def closePath(): Unit
CanvasRenderingContext2D[JC] def createImageData(imageDataOrSw: js.Any, sh: Double?): ImageData
CanvasRenderingContext2D[JC] def createLinearGradient(x0: Double, y0: Double, x1: Double, y1: Double): CanvasGradient
CanvasRenderingContext2D[JC] def createPattern(image: HTMLElement, repetition: String): CanvasPattern
CanvasRenderingContext2D[JC] def createRadialGradient(x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double): CanvasGradient
CanvasRenderingContext2D[JC] def drawImage(image: HTMLElement, offsetX: Double, offsetY: Double, width: Double?, height: Double?, canvasOffsetX: Double?, canvasOffsetY: Double?, canvasImageWidth: Double?, canvasImageHeight: Double?): Unit
CanvasRenderingContext2D[JC] def ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, anticlockwise: Boolean?): Unit
CanvasRenderingContext2D[JC] def fill(): Unit
CanvasRenderingContext2D[JC] def ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Boolean?): Unit
CanvasRenderingContext2D[JC] def fill(fillRule: CanvasFillRule?): Unit
CanvasRenderingContext2D[JC] def fill(path: Path2D): Unit
CanvasRenderingContext2D[JC] def fill(path: Path2D, fillRule: CanvasFillRule): Unit
CanvasRenderingContext2D[JC] def fillRect(x: Double, y: Double, w: Double, h: Double): Unit
CanvasRenderingContext2D[JC] var fillStyle: js.Any
CanvasRenderingContext2D[JC] def fillText(text: String, x: Double, y: Double, maxWidth: Double?): Unit
Expand All @@ -1098,8 +1105,9 @@ CanvasRenderingContext2D[JC] def getLineDash(): js.Array[Double]
CanvasRenderingContext2D[JC] var globalAlpha: Double
CanvasRenderingContext2D[JC] var globalCompositeOperation: String
CanvasRenderingContext2D[JC] var imageSmoothingEnabled: Boolean
CanvasRenderingContext2D[JC] def isPointInPath(x: Double, y: Double): Boolean
CanvasRenderingContext2D[JC] def isPointInPath(x: Double, y: Double, fillRule: String): Boolean
CanvasRenderingContext2D[JC] def isPointInPath(path: Path2D, x: Double, y: Double): Boolean
CanvasRenderingContext2D[JC] def isPointInPath(path: Path2D, x: Double, y: Double, fillRule: CanvasFillRule): Boolean
CanvasRenderingContext2D[JC] def isPointInPath(x: Double, y: Double, fillRule: CanvasFillRule?): Boolean
CanvasRenderingContext2D[JC] var lineCap: String
CanvasRenderingContext2D[JC] var lineDashOffset: Double
CanvasRenderingContext2D[JC] var lineJoin: String
Expand All @@ -1122,6 +1130,7 @@ CanvasRenderingContext2D[JC] var shadowColor: String
CanvasRenderingContext2D[JC] var shadowOffsetX: Double
CanvasRenderingContext2D[JC] var shadowOffsetY: Double
CanvasRenderingContext2D[JC] def stroke(): Unit
CanvasRenderingContext2D[JC] def stroke(path: Path2D): Unit
CanvasRenderingContext2D[JC] def strokeRect(x: Double, y: Double, w: Double, h: Double): Unit
CanvasRenderingContext2D[JC] var strokeStyle: js.Any
CanvasRenderingContext2D[JC] def strokeText(text: String, x: Double, y: Double, maxWidth: Double?): Unit
Expand Down Expand Up @@ -16627,6 +16636,17 @@ ParentNode[JT] def children: HTMLCollection[Element]
ParentNode[JT] def firstElementChild: Element
ParentNode[JT] def lastElementChild: Element
ParentNode[JT] def replaceChildren(nodes: Node | String*): Unit
Path2D[JC] def addPath(path: Path2D): Unit
Path2D[JC] def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double): Unit
Path2D[JC] def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Boolean): Unit
Path2D[JC] def arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double): Unit
Path2D[JC] def bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double): Unit
Path2D[JC] def closePath(): Unit
Path2D[JC] def ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Boolean?): Unit
Path2D[JC] def lineTo(x: Double, y: Double): Unit
Path2D[JC] def moveTo(x: Double, y: Double): Unit
Path2D[JC] def quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double): Unit
Path2D[JC] def rect(x: Double, y: Double, w: Double, h: Double): Unit
Pbkdf2Params[JT] val hash: HashAlgorithmIdentifier
Pbkdf2Params[JT] val iterations: Double
Pbkdf2Params[JT] val name: String
Expand Down
14 changes: 14 additions & 0 deletions dom/src/main/scala-2/org/scalajs/dom/CanvasFillRule.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.scalajs.dom

import scala.scalajs.js

@js.native
sealed trait CanvasFillRule extends js.Any

object CanvasFillRule {

val nonzero: CanvasFillRule = "nonzero".asInstanceOf[CanvasFillRule]

val evenodd: CanvasFillRule = "evenodd".asInstanceOf[CanvasFillRule]

}
13 changes: 13 additions & 0 deletions dom/src/main/scala-3/org/scalajs/dom/CanvasFillRule.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.scalajs.dom

import scala.scalajs.js

opaque type CanvasFillRule <: String = String

object CanvasFillRule {

val nonzero: CanvasFillRule = "nonzero"

val evenodd: CanvasFillRule = "evenodd"

}
Loading