Skip to content

Commit 45ad801

Browse files
authored
Merge pull request #335 from anilanar/window-move-to-and-move-by
Add moveTo and moveBy to Window
2 parents b9cf7f2 + 9e0102f commit 45ad801

File tree

3 files changed

+60
-9
lines changed

3 files changed

+60
-9
lines changed

api-reports/2_12.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2876,7 +2876,6 @@ raw/CanvasRenderingContext2D[JC] def isPointInPath(x: Double, y: Double): Boolea
28762876
raw/CanvasRenderingContext2D[JC] def isPointInPath(x: Double, y: Double, fillRule: String): Boolean
28772877
raw/CanvasRenderingContext2D[JC] def lineTo(x: Double, y: Double): Unit
28782878
raw/CanvasRenderingContext2D[JC] def measureText(text: String): TextMetrics
2879-
raw/CanvasRenderingContext2D[JC] def moveBy(deltaX: Double, deltaY: Double): Unit
28802879
raw/CanvasRenderingContext2D[JC] def moveTo(x: Double, y: Double): Unit
28812880
raw/CanvasRenderingContext2D[JC] def putImageData(imagedata: ImageData, dx: Double, dy: Double, dirtyX: Double?, dirtyY: Double?, dirtyWidth: Double?, dirtyHeight: Double?): Unit
28822881
raw/CanvasRenderingContext2D[JC] def quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double): Unit
@@ -24062,6 +24061,8 @@ raw/Window[JC] def innerWidth: Double
2406224061
raw/Window[JC] def length: Int
2406324062
raw/Window[JC] def localStorage: Storage
2406424063
raw/Window[JC] def matchMedia(mediaQuery: String): MediaQueryList
24064+
raw/Window[JC] def moveBy(deltaX: Int, deltaY: Int): Unit
24065+
raw/Window[JC] def moveTo(x: Int, y: Int): Unit
2406524066
raw/Window[JC] def navigator: Navigator
2406624067
raw/Window[JC] def open(url: String?, target: String?, features: String?, replace: Boolean?): Window
2406724068
raw/Window[JC] def outerHeight: Int
@@ -24077,11 +24078,15 @@ raw/Window[JC] def prompt(message: String, default: String?): String
2407724078
raw/Window[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
2407824079
raw/Window[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
2407924080
raw/Window[JC] def requestAnimationFrame(callback: js.Function1[Double, _]): Int
24081+
raw/Window[JC] def resizeBy(deltaX: Int, deltaY: Int): Unit
24082+
raw/Window[JC] def resizeTo(width: Int, height: Int): Unit
2408024083
raw/Window[JC] def screen: Screen
2408124084
raw/Window[JC] def screenY: Int
2408224085
raw/Window[JC] def scroll(x: Int, y: Int): Unit
2408324086
raw/Window[JC] def scrollBy(x: Int, y: Int): Unit
2408424087
raw/Window[JC] def scrollTo(x: Int, y: Int): Unit
24088+
raw/Window[JC] def scrollX: Double
24089+
raw/Window[JC] def scrollY: Double
2408524090
raw/Window[JC] def self: Window
2408624091
raw/Window[JC] def sessionStorage: Storage
2408724092
raw/Window[JC] def setInterval(handler: js.Function0[Any], timeout: Double): Int

api-reports/2_13.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2876,7 +2876,6 @@ raw/CanvasRenderingContext2D[JC] def isPointInPath(x: Double, y: Double): Boolea
28762876
raw/CanvasRenderingContext2D[JC] def isPointInPath(x: Double, y: Double, fillRule: String): Boolean
28772877
raw/CanvasRenderingContext2D[JC] def lineTo(x: Double, y: Double): Unit
28782878
raw/CanvasRenderingContext2D[JC] def measureText(text: String): TextMetrics
2879-
raw/CanvasRenderingContext2D[JC] def moveBy(deltaX: Double, deltaY: Double): Unit
28802879
raw/CanvasRenderingContext2D[JC] def moveTo(x: Double, y: Double): Unit
28812880
raw/CanvasRenderingContext2D[JC] def putImageData(imagedata: ImageData, dx: Double, dy: Double, dirtyX: Double?, dirtyY: Double?, dirtyWidth: Double?, dirtyHeight: Double?): Unit
28822881
raw/CanvasRenderingContext2D[JC] def quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double): Unit
@@ -24062,6 +24061,8 @@ raw/Window[JC] def innerWidth: Double
2406224061
raw/Window[JC] def length: Int
2406324062
raw/Window[JC] def localStorage: Storage
2406424063
raw/Window[JC] def matchMedia(mediaQuery: String): MediaQueryList
24064+
raw/Window[JC] def moveBy(deltaX: Int, deltaY: Int): Unit
24065+
raw/Window[JC] def moveTo(x: Int, y: Int): Unit
2406524066
raw/Window[JC] def navigator: Navigator
2406624067
raw/Window[JC] def open(url: String?, target: String?, features: String?, replace: Boolean?): Window
2406724068
raw/Window[JC] def outerHeight: Int
@@ -24077,11 +24078,15 @@ raw/Window[JC] def prompt(message: String, default: String?): String
2407724078
raw/Window[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
2407824079
raw/Window[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
2407924080
raw/Window[JC] def requestAnimationFrame(callback: js.Function1[Double, _]): Int
24081+
raw/Window[JC] def resizeBy(deltaX: Int, deltaY: Int): Unit
24082+
raw/Window[JC] def resizeTo(width: Int, height: Int): Unit
2408024083
raw/Window[JC] def screen: Screen
2408124084
raw/Window[JC] def screenY: Int
2408224085
raw/Window[JC] def scroll(x: Int, y: Int): Unit
2408324086
raw/Window[JC] def scrollBy(x: Int, y: Int): Unit
2408424087
raw/Window[JC] def scrollTo(x: Int, y: Int): Unit
24088+
raw/Window[JC] def scrollX: Double
24089+
raw/Window[JC] def scrollY: Double
2408524090
raw/Window[JC] def self: Window
2408624091
raw/Window[JC] def sessionStorage: Storage
2408724092
raw/Window[JC] def setInterval(handler: js.Function0[Any], timeout: Double): Int

src/main/scala/org/scalajs/dom/raw/lib.scala

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,6 +2762,54 @@ class Window
27622762
* MDN
27632763
*/
27642764
var lostpointercapture: js.Function1[PointerEvent, _] = js.native
2765+
2766+
/**
2767+
* Moves the window to the specified coordinates.
2768+
*
2769+
* MDN
2770+
*/
2771+
def moveTo(x: Int, y: Int): Unit = js.native
2772+
2773+
/**
2774+
* Moves the current window by a specified amount.
2775+
*
2776+
* MDN
2777+
*/
2778+
def moveBy(deltaX: Int, deltaY: Int): Unit = js.native
2779+
2780+
/**
2781+
* Dynamically resizes window.
2782+
*
2783+
* MDN
2784+
*/
2785+
def resizeTo(width: Int, height: Int): Unit = js.native
2786+
2787+
/**
2788+
* Resizes the current window by a certain amount.
2789+
*
2790+
* MDN
2791+
*/
2792+
def resizeBy(deltaX: Int, deltaY: Int): Unit = js.native
2793+
2794+
/**
2795+
* The read-only scrollX property of the Window interface returns the number
2796+
* of pixels that the document is currently scrolled horizontally. This value
2797+
* is subpixel precise in modern browsers, meaning that it isn't necessarily
2798+
* a whole number. You can get the number of pixels the document is scrolled
2799+
* vertically from the scrollY property.
2800+
*
2801+
* MDN
2802+
*/
2803+
def scrollX: Double = js.native
2804+
2805+
/**
2806+
* The read-only scrollY property of the Window interface returns the number
2807+
* of pixels that the document is currently scrolled vertically. This value
2808+
* is subpixel precise in modern browsers, meaning that it isn't necessarily
2809+
* a whole number. You can get the number of pixels the document is scrolled
2810+
* horizontally from the scrollX property.
2811+
*/
2812+
def scrollY: Double = js.native
27652813
}
27662814

27672815
/**
@@ -3901,13 +3949,6 @@ class CanvasRenderingContext2D extends js.Object {
39013949
*/
39023950
def moveTo(x: Double, y: Double): Unit = js.native
39033951

3904-
/**
3905-
* Moves the current window by a specified amount.
3906-
*
3907-
* MDN
3908-
*/
3909-
def moveBy(deltaX: Double, deltaY: Double): Unit = js.native
3910-
39113952
/**
39123953
* Returns an ImageData object representing the underlying pixel data for the area of
39133954
* the canvas denoted by the rectangle which starts at (sx, sy) and has an sw width and sh

0 commit comments

Comments
 (0)