Home | History | Annotate | Download | only in pdf

Lines Matching refs:Viewport

22  * Create a new viewport.
25 * document in the viewport
26 * @param {Function} viewportChangedCallback is run when the viewport changes
29 function Viewport(window,
40 this.fittingType_ = Viewport.FittingType.NONE;
50 Viewport.FittingType = {
62 Viewport.SCROLL_INCREMENT = 40;
68 Viewport.ZOOM_FACTORS = [0.25, 0.333, 0.5, 0.666, 0.75, 0.9, 1,
74 Viewport.PAGE_SHADOW = {top: 3, bottom: 7, left: 5, right: 5};
76 Viewport.prototype = {
119 * Called when the viewport should be updated.
127 * Called when the viewport size changes.
130 if (this.fittingType_ == Viewport.FittingType.FIT_TO_PAGE)
132 else if (this.fittingType_ == Viewport.FittingType.FIT_TO_WIDTH)
139 * @type {Object} the scroll position of the viewport.
149 * Scroll the viewport to the specified position.
157 * @type {Object} the size of the viewport excluding scrollbars.
170 * @type {number} the zoom level of the viewport.
178 * Sets the zoom of the viewport.
197 * @type {number} the width of scrollbars in the viewport in pixels.
204 * @type {Viewport.FittingType} the fitting type the viewport is currently in.
241 * Returns the page with the most pixels in the current viewport.
257 // pages visible in the viewport so we can break.
333 * Zoom the viewport so that the page-width consumes the entire viewport.
336 this.fittingType_ = Viewport.FittingType.FIT_TO_WIDTH;
350 * Zoom the viewport so that a page consumes the entire viewport. Also scrolls
354 this.fittingType_ = Viewport.FittingType.FIT_TO_PAGE;
373 this.fittingType_ = Viewport.FittingType.NONE;
374 var nextZoom = Viewport.ZOOM_FACTORS[0];
375 for (var i = 0; i < Viewport.ZOOM_FACTORS.length; i++) {
376 if (Viewport.ZOOM_FACTORS[i] < this.zoom_)
377 nextZoom = Viewport.ZOOM_FACTORS[i];
387 this.fittingType_ = Viewport.FittingType.NONE;
388 var nextZoom = Viewport.ZOOM_FACTORS[Viewport.ZOOM_FACTORS.length - 1];
389 for (var i = Viewport.ZOOM_FACTORS.length - 1; i >= 0; i--) {
390 if (Viewport.ZOOM_FACTORS[i] > this.zoom_)
391 nextZoom = Viewport.ZOOM_FACTORS[i];
444 x: pageDimensions.x + Viewport.PAGE_SHADOW.left,
445 y: pageDimensions.y + Viewport.PAGE_SHADOW.top,
446 width: pageDimensions.width - Viewport.PAGE_SHADOW.left -
447 Viewport.PAGE_SHADOW.right,
448 height: pageDimensions.height - Viewport.PAGE_SHADOW.top -
449 Viewport.PAGE_SHADOW.bottom
456 Viewport.PAGE_SHADOW.left;