Merge pull request #52 from Country/master

Miscalculation of container position
This commit is contained in:
ericdrowell 2012-07-18 23:39:28 -07:00
commit 148cde228a

View File

@ -765,17 +765,13 @@ Kinetic.Stage = Kinetic.Container.extend({
* get container position
*/
_getContentPosition: function() {
var obj = this.content;
var top = 0;
var left = 0;
while(obj && obj.tagName !== 'BODY') {
top += obj.offsetTop - obj.scrollTop;
left += obj.offsetLeft - obj.scrollLeft;
obj = obj.offsetParent;
}
var
rect = this.content.getBoundingClientRect(),
root = document.documentElement
;
return {
top: top,
left: left
top: rect.top + root.scrollTop,
left: rect.left + root.scrollLeft
};
},
/**