diff options
Diffstat (limited to 'platform/android/src/com/artifex/mupdfdemo/PageView.java')
-rw-r--r-- | platform/android/src/com/artifex/mupdfdemo/PageView.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/platform/android/src/com/artifex/mupdfdemo/PageView.java b/platform/android/src/com/artifex/mupdfdemo/PageView.java index cc00e004..3e30d1e5 100644 --- a/platform/android/src/com/artifex/mupdfdemo/PageView.java +++ b/platform/android/src/com/artifex/mupdfdemo/PageView.java @@ -539,9 +539,11 @@ public abstract class PageView extends ViewGroup { int h = bottom-top; if (mEntire != null) { - mEntireMat.setScale(w/(float)mSize.x, h/(float)mSize.y); - mEntire.setImageMatrix(mEntireMat); - mEntire.invalidate(); + if (mEntire.getWidth() != w || mEntire.getHeight() != h) { + mEntireMat.setScale(w/(float)mSize.x, h/(float)mSize.y); + mEntire.setImageMatrix(mEntireMat); + mEntire.invalidate(); + } mEntire.layout(0, 0, w, h); } @@ -631,7 +633,6 @@ public abstract class PageView extends ViewGroup { // Calling requestLayout here doesn't lead to a later call to layout. No idea // why, but apparently others have run into the problem. mPatch.layout(mPatchArea.left, mPatchArea.top, mPatchArea.right, mPatchArea.bottom); - invalidate(); } }; |