Skip to content

Commit 4096704

Browse files
author
c
committed
Added ImageSettings class to support ImageData constructors.
Ran scalafmtAll to fix formatting issues. Fixed typo in settings parameter in ImageData constructors.
1 parent a5884a0 commit 4096704

File tree

2 files changed

+42
-26
lines changed

2 files changed

+42
-26
lines changed

dom/src/main/scala/org/scalajs/dom/ImageData.scala

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,53 @@ import js.typedarray.Uint8ClampedArray
1818
@JSGlobal
1919
class ImageData extends js.Object {
2020

21-
/**
22-
* Create an ImageData instance from an array of pixel data and a width.
23-
* @param data pixel data
24-
* @param width width in pixels
21+
/** Create an ImageData instance from an array of pixel data and a width.
22+
* @param data
23+
* pixel data
24+
* @param width
25+
* width in pixels
2526
*/
2627
def this(data: Uint8ClampedArray, width: Int) = this()
2728

28-
/**
29-
* Create an ImageData instance from an array of pixel data, width, and height.
30-
* @param data pixel data
31-
* @param width width in pixels
32-
* @param height height in pixels
29+
/** Create an ImageData instance from an array of pixel data, width, and height.
30+
* @param data
31+
* pixel data
32+
* @param width
33+
* width in pixels
34+
* @param height
35+
* height in pixels
3336
*/
3437
def this(data: Uint8ClampedArray, width: Int, height: Int) = this()
3538

36-
/**
37-
* Create a blank ImageData instance from specified width and height.
38-
* @param width width in pixels
39-
* @param height height in pixels
39+
/** Create a blank ImageData instance from specified width and height.
40+
* @param width
41+
* width in pixels
42+
* @param height
43+
* height in pixels
4044
*/
4145
def this(width: Int, height: Int) = this()
4246

43-
/**
44-
* Create a blank ImageData instance from specified width, height, and settings object.
45-
* @param width width in pixels
46-
* @param height height in pixels
47-
* @param settings image settings
47+
/** Create a blank ImageData instance from specified width, height, and settings object.
48+
* @param width
49+
* width in pixels
50+
* @param height
51+
* height in pixels
52+
* @param settings
53+
* image settings
4854
*/
49-
def this(width: Int, height: Int, setings: js.Object) = this()
55+
def this(width: Int, height: Int, settings: ImageSettings) = this()
5056

51-
/**
52-
* Create a blank ImageData instance from specified pixel data, width, height, and settings object.
53-
* @param data pixel data
54-
* @param width width in pixels
55-
* @param height height in pixels
56-
* @param settings image settings
57+
/** Create a blank ImageData instance from specified pixel data, width, height, and settings object.
58+
* @param data
59+
* pixel data
60+
* @param width
61+
* width in pixels
62+
* @param height
63+
* height in pixels
64+
* @param settings
65+
* image settings
5766
*/
58-
def this(data: Uint8ClampedArray, width: Int, height: Int, setings: js.Object) = this()
67+
def this(data: Uint8ClampedArray, width: Int, height: Int, settings: ImageSettings) = this()
5968

6069
/** Is an unsigned long representing the actual width, in pixels, of the ImageData. */
6170
def width: Int = js.native
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
trait ImageSettings extends js.Object {
6+
var colorSpace: js.UndefOr[String] = js.undefined
7+
}

0 commit comments

Comments
 (0)