private float getScrollScaleRatio() { final Page page = pages.get(0); if (page == null || page.bounds == null) { return 0; } final float v = zoomModel.getZoom(); return getWidth() * v / page.bounds.width(); }
void invalidatePageSizes() { if (!isInitialized) { return; } float heightAccum = 0; int width = getWidth(); float zoom = zoomModel.getZoom(); for (int i = 0; i < pages.size(); i++) { Page page = pages.get(i); float pageHeight = page.getPageHeight(width, zoom); page.setBounds(new RectF(0, heightAccum, width * zoom, heightAccum + pageHeight)); heightAccum += pageHeight; } }
private int getRightLimit() { return (int) (getWidth() * zoomModel.getZoom()) - getWidth(); }