You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2018/09/17 17:51:36 UTC
[royale-asjs] branch develop updated: fix PointUtils to work on IE11
This is an automated email from the ASF dual-hosted git repository.
carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 2d40c48 fix PointUtils to work on IE11
2d40c48 is described below
commit 2d40c484b45d60a5da2802a18beef19aacd2bc3e
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Sep 17 19:51:29 2018 +0200
fix PointUtils to work on IE11
---
.../src/main/royale/org/apache/royale/utils/PointUtils.as | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/PointUtils.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/PointUtils.as
index f96e61c..139a4cd 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/PointUtils.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/PointUtils.as
@@ -73,8 +73,8 @@ package org.apache.royale.utils
var element:HTMLElement = local.element as HTMLElement;
if ( element.getBoundingClientRect ) {// TODO take scrollbar widths into account
var rect:Object = element.getBoundingClientRect();
- x = x - rect.left - window.scrollX;
- y = y - rect.top - window.scrollY;
+ x = x - rect.left - window.pageXOffset;//window.scrollX doesn't work on IE11
+ y = y - rect.top - window.pageYOffset;//window.scrollY doesn't work on IE11
} else { // for older browsers, but offsetParent is soon to be deprecated from chrome
do {
@@ -122,12 +122,11 @@ package org.apache.royale.utils
var x:Number = pt.x;
var y:Number = pt.y;
var element:HTMLElement = local.element as HTMLElement;
-
- if ( element.getBoundingClientRect ) {// TODO take scrollbar widths into account
- var rect:Object = element.getBoundingClientRect();
- x = rect.left + x + window.scrollX;
- y = rect.top + y + window.scrollY;
- } else { // for older browsers, but offsetParent is soon to be deprecated from from chrome
+ if ( element.getBoundingClientRect ) {// TODO take scrollbar widths into account
+ var rect:Object = element.getBoundingClientRect();
+ x = rect.left + x + window.pageXOffset;//window.scrollX doesn't work on IE11
+ y = rect.top + y + window.pageYOffset;//window.scrollY doesn't work on IE11
+ } else { // for older browsers, but offsetParent is soon to be deprecated from from chrome
do {
x += element.offsetLeft;
y += element.offsetTop;