Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a regression in multi-drag for Clips/Transitions #4335

Merged
merged 2 commits into from
Aug 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/timeline/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,6 @@ App.controller("TimelineCtrl", function ($scope) {
// Re-index Layer Y values
$scope.updateLayerIndex();
}
$scope.$digest();
}
// return true
return true;
Expand Down
24 changes: 9 additions & 15 deletions src/timeline/js/directives/clip.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,22 +330,16 @@ App.directive("tlClip", function ($timeout) {

// Move all other selected clips with this one if we have more than one clip
$(".ui-selected").each(function () {
clip_name = $(this).attr("id");
var newX, newY;
if (move_clips[clip_name] && ( move_clips[clip_name]['top'] && move_clips[clip_name]['left'] )) {
newY = move_clips[clip_name]['top'] + y_offset;
newX = move_clips[clip_name]['left'] + x_offset;
} else {
move_clips[clip_name] = {};
newY = this.style.top + y_offset;
newX = this.style.left + x_offset;
if (move_clips[$(this).attr("id")]) {
let newY = move_clips[$(this).attr("id")]["top"] + y_offset;
let newX = move_clips[$(this).attr("id")]["left"] + x_offset;
//update the clip location in the array
move_clips[$(this).attr("id")]["top"] = newY;
move_clips[$(this).attr("id")]["left"] = newX;
//change the element location
$(this).css("left", newX);
$(this).css("top", newY);
}
//update the clip location in the array
move_clips[$(this).attr("id")]["top"] = newY;
move_clips[$(this).attr("id")]["left"] = newX;
//change the element location
$(this).css("left", newX);
$(this).css("top", newY);
});
},
revert: function (valid) {
Expand Down
26 changes: 9 additions & 17 deletions src/timeline/js/directives/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,24 +278,16 @@ App.directive("tlTransition", function () {

// Move all other selected transitions with this one
$(".ui-selected").each(function () {
transition_name = $(this).attr("id");
var newX, newY;
if (move_clips[transition_name] && ( move_clips[transition_name]['top'] && move_clips[clip_name]['left'] )) {
newY = move_clips[transition_name]['top'] + y_offset;
newX = move_clips[transition_name]['left'] + x_offset;
} else {
// If this transition is not yet in move_clips, add it.
move_clips[transition_name] = {};
newY = this.style.top + y_offset;
newX = this.style.left + x_offset;
if (move_transitions[$(this).attr("id")]) {
let newY = move_transitions[$(this).attr("id")]["top"] + y_offset;
let newX = move_transitions[$(this).attr("id")]["left"] + x_offset;
// Update the transition location in the array
move_transitions[$(this).attr("id")]["top"] = newY;
move_transitions[$(this).attr("id")]["left"] = newX;
// Change the element location
$(this).css("left", newX);
$(this).css("top", newY);
}
// Update the transition location in the array
move_transitions[$(this).attr("id")]["top"] = newY;
move_transitions[$(this).attr("id")]["left"] = newX;
// Change the element location
$(this).css("left", newX);
$(this).css("top", newY);

});

},
Expand Down