Commit Graph

60 Commits

Author SHA1 Message Date
Yury Delendik
4065a21f8c Merge pull request #7029 from Snuffleupagus/PDFThumnailView-refactor-canvas-to-image
[PDFThumbnailView] Re-factor the `canvas` to `image` conversion such that we always render to a `canvas`, and then replace it with an `image` once rendering is done
2016-03-07 14:00:39 -06:00
Jonas Jenwald
39cba5d25d Remove PDFThumbnailViewer_ensureThumbnailVisible
Functionality wise, `ensureThumbnailVisible` is essentially just a shorthand for `scrollThumbnailIntoView`. (And note that `PDFViewer` doesn't implement a `ensurePageVisible` method.)

The only remaining usage of `PDFThumbnailViewer_ensureThumbnailVisible` is inside `PDFPresentationMode`, which introduces an otherwise unnecessary `PDFThumbnailViewer` dependency there.

We're already relying on the `presentationmodechanged` event, in various files, to track the state of Presentation Mode. Thus we can simply listen for that event in `PDFSidebar` too, and update the thumbnails if necessary.
2016-02-28 18:21:59 +01:00
Jonas Jenwald
b5582e14a9 [PDFThumbnailView] Re-factor the canvas to image conversion such that we always render to a canvas, and then replace it with an image once rendering is done
*This is a follow-up to PRs 6299 and 6441.*

The patch also adds an option to `PDFThumbnailView`, that disables the canvas-to-image conversion entirely, which might be useful in the context of issue 7026.
2016-02-28 18:18:12 +01:00
Manas
a2ba1b8189 Uses editorconfig to maintain consistent coding styles
Removes the following as they unnecessary
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
2015-11-14 07:32:18 +05:30
fkaelberer
047d61ed1f Update thumbnail style only when sidebar is visible 2015-01-27 21:08:36 +01:00
Jonas Jenwald
878aa76c15 Refactor PDFThumbnailView to look more similar to PDFPageView
This includes an optimization to zero the height and width of existing thumbnail canvases, when they are removed and recreated during rotation of the document. (Credit goes to nnethercote, who initially found this in PR 4920.)
2015-01-26 20:52:45 +01:00
Jonas Jenwald
7f8f404536 Rename ThumbnailView to PDFThumbnailView and refactor it to be more class-like 2015-01-26 20:52:44 +01:00
Jonas Jenwald
64ba38008f Rename the thumbnail_view.js file 2015-01-25 17:21:53 +01:00
Jonas Jenwald
dfa993d13d Fix function names in PDFThumbnailViewer
Also updates a couple of the JSDoc comments.
2015-01-25 17:21:29 +01:00
Jonas Jenwald
c55dcf19a0 Move PDFThumbnailViewer to its own file 2015-01-24 15:41:18 +01:00