From 37382b7a9f8471a9547787e51984e560545ad872 Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Tue, 21 Feb 2012 11:30:04 +0000 Subject: Android app: implement Tor's request to clamp vertical position when height within screen --- android/src/com/artifex/mupdf/ReaderView.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'android') diff --git a/android/src/com/artifex/mupdf/ReaderView.java b/android/src/com/artifex/mupdf/ReaderView.java index 2715b55d..25945f20 100644 --- a/android/src/com/artifex/mupdf/ReaderView.java +++ b/android/src/com/artifex/mupdf/ReaderView.java @@ -380,6 +380,12 @@ public class ReaderView extends AdapterView cvLeft += corr.x; cvTop += corr.y; cvBottom += corr.y; + } else if (cv.getMeasuredHeight() <= getHeight()) { + // When the current view is as small as the screen in height, clamp + // it vertically + Point corr = getCorrection(getScrollBounds(cvLeft, cvTop, cvRight, cvBottom)); + cvTop += corr.y; + cvBottom += corr.y; } cv.layout(cvLeft, cvTop, cvRight, cvBottom); -- cgit v1.2.3