aboutsummaryrefslogtreecommitdiffstats
path: root/src/types/Box.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/types/Box.js')
-rw-r--r--src/types/Box.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/types/Box.js b/src/types/Box.js
index 5c31535..6d7d8a9 100644
--- a/src/types/Box.js
+++ b/src/types/Box.js
@@ -95,7 +95,7 @@ export default class Box {
// offset by window scroll position, because getBoundingClientRect changes when window is scrolled
this.x += globals.window.pageXOffset
this.y += globals.window.pageYOffset
- return this
+ return new Box(this)
}
toString () {
@@ -166,7 +166,7 @@ registerMethods({
// Firefox does not support clientHeight and returns 0
// https://bugzilla.mozilla.org/show_bug.cgi?id=874811
if (!width && !height) {
- var style = window.getComputedStyle(this.node)
+ var style = globals.window.getComputedStyle(this.node)
width = parseFloat(style.getPropertyValue('width'))
height = parseFloat(style.getPropertyValue('height'))
}