From 3bbf32b285405562471fa594c283e271d347734e Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 12 Apr 2012 10:52:32 -0700 Subject: Borders are not factored into offset calculations by the browser, so we have to adjust for them. Also, we should set webkit-transform-style to preserve-3d if elements are rotated (until we also support flattened mode). Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/view-utils.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'js/helper-classes') diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 4a6c2503..addabba5 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js @@ -658,6 +658,21 @@ exports.ViewUtils = Montage.create(Component, { // if (elt.__ninjaXOff) xOff = elt.__ninjaXOff; // if (elt.__ninjaYOff) yOff = elt.__ninjaYOff; var offset = [xOff, yOff]; + if(elt.offsetParent && (elt.offsetParent !== this._stageElement)) + { + var pS = elt.ownerDocument.defaultView.getComputedStyle(elt.offsetParent); + + var border = parseInt(pS.getPropertyValue("border")); + + if(border) + { + var bl = parseInt(pS.getPropertyValue("border-left-width")), + bt = parseInt(pS.getPropertyValue("border-top-width")); + + offset[0] += bl; + offset[1] += bt; + } + } if(elt === this._stageElement) { -- cgit v1.2.3