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-01 16:11:44 +08:00
parent a0f602c6b0
commit 2768b3ed64

View File

@ -156,14 +156,17 @@
} }
} }
}, },
rescale : function(ratio, keep_shown) { /**
* @param {boolean=} force_show Force showing the page for smooth rescaling
*/
rescale : function(ratio, force_show) {
if(ratio == 0) { if(ratio == 0) {
this.set_r = this.default_r; this.set_r = this.default_r;
} else { } else {
this.set_r = ratio; this.set_r = ratio;
} }
if (keep_shown) if (force_show)
this.show(); // Refresh content this.show(); // Refresh content
else else
this.hide(); // Wait for redraw this.hide(); // Wait for redraw
@ -298,7 +301,7 @@
var p = _.pages[idx]; var p = _.pages[idx];
p.$d.replaceWith(data); p.$d.replaceWith(data);
var $new_pf = p.find('.' + CSS_CLASS_NAMES.page_frame); var $new_pf = _.$container.find('#' + CSS_CLASS_NAMES.page_frame + p.n.toString(16));
p = new Page($new_pf, _.$container); p = new Page($new_pf, _.$container);
p.hide(); p.hide();
p.rescale(_.scale); p.rescale(_.scale);
@ -537,6 +540,7 @@
// TODO: preserve active_page idx after rescaling // TODO: preserve active_page idx after rescaling
get_active_page : function () { get_active_page : function () {
var pl = this.pages;
for(var i = 0, l = pl.length; i < l; ++i) { for(var i = 0, l = pl.length; i < l; ++i) {
if (pl[i].is_visible()) if (pl[i].is_visible())
return pl[i]; return pl[i];