@@ -86,25 +86,28 @@ class CanvasRenderingContext2D extends js.Object {
86
86
*/
87
87
def save (): Unit = js.native
88
88
89
- /** Adds an arc to the path which is centered at (x, y) position with radius r starting at startAngle and ending at
90
- * endAngle going in the given direction by anticlockwise (defaulting to clockwise).
89
+ /** The arc() method creates a circular arc centered at (x, y) with a radius of radius. The path starts at startAngle,
90
+ * ends at endAngle, and travels in the direction given by counterclockwise (defaulting to clockwise).
91
91
*/
92
92
def arc (x : Double , y : Double , radius : Double , startAngle : Double , endAngle : Double ,
93
- anticlockwise : Boolean ): Unit = js.native
93
+ counterclockwise : Boolean ): Unit = js.native
94
94
95
- /** Adds an arc to the path which is centered at (x, y) position with radius r starting at startAngle and ending at
96
- * endAngle going in the given direction by anticlockwise (defaulting to clockwise).
95
+ /** The arc() method creates a circular arc centered at (x, y) with a radius of radius. The path starts at startAngle,
96
+ * ends at endAngle, and travels in the direction given by counterclockwise (defaulting to clockwise).
97
97
*/
98
98
def arc (x : Double , y : Double , radius : Double , startAngle : Double , endAngle : Double ): Unit = js.native
99
99
100
100
/** Returns a TextMetrics object. */
101
101
def measureText (text : String ): TextMetrics = js.native
102
102
103
103
/** Reports whether or not the specified point is contained in the current path. */
104
- def isPointInPath (x : Double , y : Double , fillRule : String ): Boolean = js.native
104
+ def isPointInPath (x : Double , y : Double , fillRule : CanvasFillRule = js.native ): Boolean = js.native
105
105
106
106
/** Reports whether or not the specified point is contained in the current path. */
107
- def isPointInPath (x : Double , y : Double ): Boolean = js.native
107
+ def isPointInPath (path : Path2D , x : Double , y : Double ): Boolean = js.native
108
+
109
+ /** Reports whether or not the specified point is contained in the current path. */
110
+ def isPointInPath (path : Path2D , x : Double , y : Double , fillRule : CanvasFillRule ): Boolean = js.native
108
111
109
112
/** Adds a quadratic Bézier curve to the current path. */
110
113
def quadraticCurveTo (cpx : Double , cpy : Double , x : Double , y : Double ): Unit = js.native
@@ -140,13 +143,13 @@ class CanvasRenderingContext2D extends js.Object {
140
143
def getLineDash (): js.Array [Double ] = js.native
141
144
142
145
/** Fills the subpaths with the current fill style. */
143
- def fill (): Unit = js.native
146
+ def fill (fillRule : CanvasFillRule = js.native ): Unit = js.native
144
147
148
+ /** Fills the subpaths with the current fill style. */
145
149
def fill (path : Path2D ): Unit = js.native
146
150
147
- def fill (fillRule : String ): Unit = js.native
148
-
149
- def fill (path : Path2D , fillRule : String ): Unit = js.native
151
+ /** Fills the subpaths with the current fill style. */
152
+ def fill (path : Path2D , fillRule : CanvasFillRule ): Unit = js.native
150
153
151
154
/** Creates a new, blank ImageData object with the specified dimensions. All of the pixels in the new object are
152
155
* transparent black.
@@ -169,7 +172,17 @@ class CanvasRenderingContext2D extends js.Object {
169
172
/** Creates a clipping path from the current sub-paths. Everything drawn after clip() is called appears inside the
170
173
* clipping path only. For an example, see Clipping paths in the Canvas tutorial.
171
174
*/
172
- def clip (fillRule : String = js.native): Unit = js.native
175
+ def clip (fillRule : CanvasFillRule = js.native): Unit = js.native
176
+
177
+ /** Creates a clipping path from the current sub-paths. Everything drawn after clip() is called appears inside the
178
+ * clipping path only. For an example, see Clipping paths in the Canvas tutorial.
179
+ */
180
+ def clip (path : Path2D ): Unit = js.native
181
+
182
+ /** Creates a clipping path from the current sub-paths. Everything drawn after clip() is called appears inside the
183
+ * clipping path only. For an example, see Clipping paths in the Canvas tutorial.
184
+ */
185
+ def clip (path : Path2D , fillRule : CanvasFillRule ): Unit = js.native
173
186
174
187
/** Sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black.
175
188
*/
@@ -225,9 +238,9 @@ class CanvasRenderingContext2D extends js.Object {
225
238
def createLinearGradient (x0 : Double , y0 : Double , x1 : Double , y1 : Double ): CanvasGradient = js.native
226
239
227
240
/** The ellipse() method creates an elliptical arc centered at (x, y) with the radii radiusX and radiusY. The path
228
- * starts at startAngle and ends at endAngle, and travels in the direction given by anticlockwise (defaulting to
241
+ * starts at startAngle and ends at endAngle, and travels in the direction given by counterclockwise (defaulting to
229
242
* clockwise).
230
243
*/
231
244
def ellipse (x : Double , y : Double , radiusX : Double , radiusY : Double , rotation : Double , startAngle : Double ,
232
- endAngle : Double , anticlockwise : Boolean = js.native): Unit = js.native
245
+ endAngle : Double , counterclockwise : Boolean = js.native): Unit = js.native
233
246
}
0 commit comments