summaryrefslogtreecommitdiff
path: root/android/source/src/java/org/libreoffice/LOKitThread.java
diff options
context:
space:
mode:
Diffstat (limited to 'android/source/src/java/org/libreoffice/LOKitThread.java')
-rw-r--r--android/source/src/java/org/libreoffice/LOKitThread.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/android/source/src/java/org/libreoffice/LOKitThread.java b/android/source/src/java/org/libreoffice/LOKitThread.java
index 31d3b96440ed..4dd403dd2d0c 100644
--- a/android/source/src/java/org/libreoffice/LOKitThread.java
+++ b/android/source/src/java/org/libreoffice/LOKitThread.java
@@ -8,6 +8,7 @@ import android.view.KeyEvent;
import org.libreoffice.canvas.SelectionHandle;
import org.libreoffice.ui.LibreOfficeUIActivity;
+import org.mozilla.gecko.ZoomConstraints;
import org.mozilla.gecko.gfx.CairoImage;
import org.mozilla.gecko.gfx.ComposedTileLayer;
import org.mozilla.gecko.gfx.GeckoLayerClient;
@@ -197,6 +198,11 @@ class LOKitThread extends Thread {
mInvalidationHandler = new InvalidationHandler(mContext);
mTileProvider = TileProviderFactory.create(mContext, mInvalidationHandler, filePath);
+ // Set min zoom to the page width so that you cannot zoom below page width
+ // applies to all types of document; in the future spreadsheets may be singled out
+ float minZoom = mLayerClient.getViewportMetrics().getWidth()/mTileProvider.getPageWidth();
+ mLayerClient.setZoomConstraints(new ZoomConstraints(true, 0.0f, minZoom, 0.0f));
+
if (mTileProvider.isReady()) {
LOKitShell.showProgressSpinner(mContext);
refresh();