draw a specific page number
This commit is contained in:
parent
f163b7ba6e
commit
2f34a49483
1 changed files with 14 additions and 4 deletions
|
@ -480,13 +480,23 @@ function ComicBook(id, srcs, opts) {
|
|||
preload(i);
|
||||
};
|
||||
|
||||
ComicBook.prototype.pageLoaded = function (page_no) {
|
||||
return (typeof loaded[page_no-1] !== "undefined");
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw the current page in the canvas
|
||||
*
|
||||
* TODO: break this down into drawSinglePage() & drawDoublePage()?
|
||||
* TODO: if the current browser doesn't have canvas support, use img tags
|
||||
*/
|
||||
ComicBook.prototype.drawPage = function() {
|
||||
ComicBook.prototype.drawPage = function(page_no) {
|
||||
|
||||
// if a specific page is given try to render it, if not bail and wait for preload() to render it
|
||||
if (typeof page_no === "number" && page_no < srcs.length) {
|
||||
pointer = page_no-1;
|
||||
if (!this.pageLoaded(page_no)) {
|
||||
this.showControl("loadingIndicator");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var zoom_scale;
|
||||
var offsetW = 0, offsetH = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue