1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +00:00
This commit is contained in:
Lu Wang 2013-11-05 19:08:15 +08:00
parent e11195e8f4
commit 56f87cdec5

View File

@ -179,13 +179,12 @@
/*
* return the coordinate of the top-left corner of container
* in our coordinate system
* may or may not work if there are nodes between p.parentNode and p.offsetParent
*/
position : function () {
var rect = this.$p[0].getBoundingClientRect();
// getBoundingClientRect will be called on $container
// for a lot of times(= #pages), just hope JIT works
var rect_c = this.$container[0].getBoundingClientRect();
return [rect_c.left-rect.left, rect_c.top-rect.top];
var p = this.$p[0];
var c = p.parentNode;
return [c.scrollLeft - p.offsetLeft - p.clientLeft, c.scrollTop - p.offsetTop - p.clientTop];
}
});