Skip to content

Commit 351a511

Browse files
authored
Merge pull request #85 from rhiroshi/ctrl_zoom
Adds CTRL+Mouse wheel zoom
2 parents 87f840b + 702f039 commit 351a511

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

app/editor/boot.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,17 @@ thin.init_ = function() {
792792
}
793793
});
794794

795+
// Mouse wheel zoom
796+
main.getMain().getElement().addEventListener('mousewheel', function(e) {
797+
var workspace = thin.core.getActiveWorkspace();
798+
if (!e.ctrlKey || !workspace) return;
799+
if (e.wheelDeltaY < 0) {
800+
workspace.getAction().actionSetZoom(workspace.getUiStatusForZoom() - 10);
801+
} else {
802+
workspace.getAction().actionSetZoom(workspace.getUiStatusForZoom() + 10);
803+
}
804+
});
805+
795806
// Zoom in
796807
var toolZoomIn = toolbar.setupChild('zoom-in',
797808
new thin.ui.ToolbarButton(thin.t('button_zoom_in'), new thin.ui.Icon('zoom-in')),

0 commit comments

Comments
 (0)