1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00
This commit is contained in:
Lu Wang 2013-11-07 16:43:55 +08:00
parent 85b4de4898
commit 2557c311a6

View File

@ -711,15 +711,13 @@
if(ok) { if(ok) {
var _ = this; var _ = this;
var scale = this.scale;
var _pos = [pos[0] * scale, pos[1] * scale]
/* page should of type Page */ /* page should of type Page */
var transform_and_scroll = function(page) { var transform_and_scroll = function(page) {
_pos = transform(page.ctm, _pos); pos = transform(page.ctm, pos);
if(upside_down) { if(upside_down) {
_pos[1] = page.height() - _pos[1]; pos[1] = page.original_height - pos[1];
} }
_.scroll_to(target_page_idx, _pos); _.scroll_to(target_page_idx, pos);
}; };
if (target_page.loaded) { if (target_page.loaded) {
@ -739,7 +737,7 @@
/** /**
* @param{number} page_idx * @param{number} page_idx
* @param{Array=} pos [x,y], where (0,0) is the top-left corner * @param{Array=} pos [x,y] in UNSCALED COORDINATION, where (0,0) is the top-left corner
*/ */
scroll_to : function(page_idx, pos) { scroll_to : function(page_idx, pos) {
var target_page = this.pages[page_idx]; var target_page = this.pages[page_idx];
@ -751,8 +749,9 @@
var cur_target_pos = target_page.position(); var cur_target_pos = target_page.position();
var container = this.container; var container = this.container;
container.scrollLeft += pos[0] - cur_target_pos[0]; var scale = this.scale;
container.scrollTop += pos[1] - cur_target_pos[1]; container.scrollLeft += pos[0] * scale - cur_target_pos[0];
container.scrollTop += pos[1] * scale - cur_target_pos[1];
}, },
__last_member__ : 'no comma' /*,*/ __last_member__ : 'no comma' /*,*/