From 8212e2062ed3791150e3e5973d4ce1c0625c09c8 Mon Sep 17 00:00:00 2001 From: rhiroshi Date: Fri, 4 Sep 2020 16:44:28 -0300 Subject: [PATCH 1/4] Added mouse wheel zoom --- app/editor/boot.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/editor/boot.js b/app/editor/boot.js index 690721fe..34bbe7aa 100644 --- a/app/editor/boot.js +++ b/app/editor/boot.js @@ -792,6 +792,17 @@ thin.init_ = function() { } }); + // Mouse wheel zoom + document.body.addEventListener('mousewheel', function(e){ + var workspace = thin.core.getActiveWorkspace(); + if(e.ctrlKey != true || !workspace) return; + if(e.wheelDeltaY < 0) { + workspace.getAction().actionSetZoom(workspace.getUiStatusForZoom() - 10); + }else { + workspace.getAction().actionSetZoom(workspace.getUiStatusForZoom() + 10); + } + }) + // Zoom in var toolZoomIn = toolbar.setupChild('zoom-in', new thin.ui.ToolbarButton(thin.t('button_zoom_in'), new thin.ui.Icon('zoom-in')), From c062237b08c42767e0ff135d7c794345103fd30b Mon Sep 17 00:00:00 2001 From: "Rafael H.F.S" Date: Tue, 13 Oct 2020 13:25:39 -0300 Subject: [PATCH 2/4] Update app/editor/boot.js Co-authored-by: Katsuya HIDAKA --- app/editor/boot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/editor/boot.js b/app/editor/boot.js index 34bbe7aa..e0e3ebdc 100644 --- a/app/editor/boot.js +++ b/app/editor/boot.js @@ -793,7 +793,7 @@ thin.init_ = function() { }); // Mouse wheel zoom - document.body.addEventListener('mousewheel', function(e){ + main.getMain().getElement().addEventListener('mousewheel', function(e) { var workspace = thin.core.getActiveWorkspace(); if(e.ctrlKey != true || !workspace) return; if(e.wheelDeltaY < 0) { From f2f9c8f7551d5a58a94b10ebb7b093ce33b6dd00 Mon Sep 17 00:00:00 2001 From: "Rafael H.F.S" Date: Tue, 13 Oct 2020 13:27:05 -0300 Subject: [PATCH 3/4] Update app/editor/boot.js Co-authored-by: Katsuya HIDAKA --- app/editor/boot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/editor/boot.js b/app/editor/boot.js index e0e3ebdc..5040317d 100644 --- a/app/editor/boot.js +++ b/app/editor/boot.js @@ -795,7 +795,7 @@ thin.init_ = function() { // Mouse wheel zoom main.getMain().getElement().addEventListener('mousewheel', function(e) { var workspace = thin.core.getActiveWorkspace(); - if(e.ctrlKey != true || !workspace) return; + if (!e.ctrlKey || !workspace) return; if(e.wheelDeltaY < 0) { workspace.getAction().actionSetZoom(workspace.getUiStatusForZoom() - 10); }else { From 702f039a10cef343614a39216b39572db851f8d1 Mon Sep 17 00:00:00 2001 From: "Rafael H.F.S" Date: Tue, 13 Oct 2020 13:27:33 -0300 Subject: [PATCH 4/4] Update app/editor/boot.js Co-authored-by: Katsuya HIDAKA --- app/editor/boot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/editor/boot.js b/app/editor/boot.js index 5040317d..92c81e48 100644 --- a/app/editor/boot.js +++ b/app/editor/boot.js @@ -796,12 +796,12 @@ thin.init_ = function() { main.getMain().getElement().addEventListener('mousewheel', function(e) { var workspace = thin.core.getActiveWorkspace(); if (!e.ctrlKey || !workspace) return; - if(e.wheelDeltaY < 0) { + if (e.wheelDeltaY < 0) { workspace.getAction().actionSetZoom(workspace.getUiStatusForZoom() - 10); - }else { + } else { workspace.getAction().actionSetZoom(workspace.getUiStatusForZoom() + 10); } - }) + }); // Zoom in var toolZoomIn = toolbar.setupChild('zoom-in',