Skip to content

Commit

Permalink
JS: Separate Ctrl, Shift responses to scroll/zoom (OpenShot#4492)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc authored Nov 9, 2021
1 parent 12d85a9 commit 58f9962
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/timeline/js/directives/ruler.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ App.directive("tlScrollableTracks", function () {
element.on("wheel",function (e) {
if (e.ctrlKey) {
e.preventDefault(); // Don't scroll like a browser
if (e.originalEvent.deltaY > 0) { // Scroll down: Zoom out
var delta = e.originalEvent.deltaY * (e.shiftKey ? -1 : 1);
if (delta > 0) { // Scroll down: Zoom out
/*global timeline*/
timeline.zoomOut();
} else { // Scroll Up: Zoom in
/*global timeline*/
timeline.zoomIn();
}
}
if (e.shiftKey) {
else if (e.shiftKey) {
let current_scroll = $("#scrolling_tracks").scrollLeft()
$("#scrolling_tracks").scrollLeft(current_scroll + e.originalEvent.deltaY);
}
Expand Down

0 comments on commit 58f9962

Please sign in to comment.