loleaflet/src/map/handler/Map.Scroll.js |   23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

New commits:
commit ddf37207ff01d5dbf80cc19126828ae81f99ca52
Author:     merttumer <mert.tu...@collabora.com>
AuthorDate: Tue Feb 12 21:45:14 2019 +0300
Commit:     Jan Holesovsky <ke...@collabora.com>
CommitDate: Fri Feb 22 11:54:10 2019 +0100

    Disable intermediate zoom levels on calc
    
    For calc only 100% and 200% zoom is possible
    It zooms between by mousewheel
    Signed-off-by: merttumer <mert.tu...@collabora.com>
    
    Change-Id: I8565c32ca3da1cd0fa3be4b88a9733f2f831a5a8
    Reviewed-on: https://gerrit.libreoffice.org/67744
    Reviewed-by: Aron Budea <aron.bu...@collabora.com>
    Tested-by: Aron Budea <aron.bu...@collabora.com>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/loleaflet/src/map/handler/Map.Scroll.js 
b/loleaflet/src/map/handler/Map.Scroll.js
index 9643def07..ee7f2cdd0 100644
--- a/loleaflet/src/map/handler/Map.Scroll.js
+++ b/loleaflet/src/map/handler/Map.Scroll.js
@@ -82,11 +82,26 @@ L.Map.Scroll = L.Handler.extend({
                this._startTime = null;
 
                if (!delta) { return; }
-
                if (map.options.scrollWheelZoom === 'center') {
-                       map.setZoom(zoom + delta);
-               } else {
-                       map.setZoomAround(this._lastMousePos, zoom + delta);
+                       if (map.getDocType() === 'spreadsheet') {
+                               if (delta > 0) {
+                                       map.setZoom(14); // 200%
+                               } else {
+                                       map.setZoom(10); // 100%
+                               }
+                       } else {
+                               map.setZoom(zoom + delta);
+                       }
+               } else { // eslint-disable-next-line no-lonely-if
+                       if (map.getDocType() === 'spreadsheet') { 
+                               if (delta > 0) {
+                                       map.setZoomAround(this._lastMousePos, 
14); // 200%
+                               } else {
+                                       map.setZoomAround(this._lastMousePos, 
10); // 100%
+                               }
+                       } else {
+                               map.setZoomAround(this._lastMousePos, zoom + 
delta);
+                       }
                }
        }
 });
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to