Skip to content

Commit

Permalink
Merge pull request OpenShot#4321 from OpenShot/webkit-feature-parity
Browse files Browse the repository at this point in the history
Webkit feature parity
  • Loading branch information
ferdnyc authored Nov 9, 2021
2 parents b72327d + ba27c0a commit ab9e763
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/timeline/js/directives/ruler.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,20 @@ 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();
}
}
else if (e.shiftKey) {
e.preventDefault();
let current_scroll = $("#scrolling_tracks").scrollLeft();
$("#scrolling_tracks").scrollLeft(current_scroll + e.originalEvent.deltaY);
}
});

// Sync ruler to track scrolling
Expand Down Expand Up @@ -143,7 +149,6 @@ App.directive("tlBody", function () {
};
});


// The HTML5 canvas ruler
App.directive("tlRuler", function ($timeout) {
return {
Expand Down Expand Up @@ -257,12 +262,10 @@ App.directive("tlRuler", function ($timeout) {
};

scope.$watch("project.scale + project.duration + scrollLeft + element.width()", function (val) {
if (val) {
$timeout(function () {
drawTimes();
return;
} , 0);
}
$timeout(function () {
drawTimes();
return;
} , 0);
});

}
Expand Down

0 comments on commit ab9e763

Please sign in to comment.