diff options
author | Paul Gardiner <paulg.artifex@glidos.net> | 2013-02-04 16:40:58 +0000 |
---|---|---|
committer | Paul Gardiner <paulg.artifex@glidos.net> | 2013-02-04 16:40:58 +0000 |
commit | 4fcd5c1ff4c3a84921fa97715a68f870a2ab857b (patch) | |
tree | a12fffcad25f6be77f09b2e7d3ee33c97e383476 /android | |
parent | 0d2fc1688100f69644e3238da941f6f0c7b4618a (diff) | |
download | mupdf-4fcd5c1ff4c3a84921fa97715a68f870a2ab857b.tar.xz |
Android: alter zoom range for reflow mode
Diffstat (limited to 'android')
-rw-r--r-- | android/src/com/artifex/mupdfdemo/ReaderView.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/android/src/com/artifex/mupdfdemo/ReaderView.java b/android/src/com/artifex/mupdfdemo/ReaderView.java index f16b39b3..11f33bb4 100644 --- a/android/src/com/artifex/mupdfdemo/ReaderView.java +++ b/android/src/com/artifex/mupdfdemo/ReaderView.java @@ -32,6 +32,7 @@ public class ReaderView extends AdapterView<Adapter> private static final float MIN_SCALE = 1.0f; private static final float MAX_SCALE = 5.0f; + private static final float REFLOW_SCALE_FACTOR = 0.5f; private Adapter mAdapter; private int mCurrent; // Adapter's index for the current view @@ -424,7 +425,10 @@ public class ReaderView extends AdapterView<Adapter> public boolean onScale(ScaleGestureDetector detector) { float previousScale = mScale; - mScale = Math.min(Math.max(mScale * detector.getScaleFactor(), MIN_SCALE), MAX_SCALE); + float scale_factor = mReflow ? REFLOW_SCALE_FACTOR : 1.0f; + float min_scale = MIN_SCALE * scale_factor; + float max_scale = MAX_SCALE * scale_factor; + mScale = Math.min(Math.max(mScale * detector.getScaleFactor(), min_scale), max_scale); if (mReflow) { applyToChildren(new ViewMapper() { |