Out of bounds correction on audio clip movement
This commit is contained in:
@@ -60,9 +60,10 @@ func _input(event):
|
||||
if track != -1:
|
||||
track_idx = track
|
||||
|
||||
var clip_length = end_time - start_time
|
||||
|
||||
if event.is_command_or_control_pressed():
|
||||
if not was_snapping:
|
||||
var clip_length = end_time - start_time
|
||||
start_time = snapped(start_time, timeline.time_interval)
|
||||
end_time = start_time + clip_length
|
||||
accumulated_movement = 0
|
||||
@@ -73,12 +74,16 @@ func _input(event):
|
||||
|
||||
if snapped_movement != 0:
|
||||
if start_time + snapped_movement < 0:
|
||||
start_time = 0
|
||||
end_time = start_time + clip_length
|
||||
return
|
||||
start_time += snapped_movement
|
||||
end_time += snapped_movement
|
||||
accumulated_movement -= snapped_movement
|
||||
else:
|
||||
if start_time + movement_time < 0:
|
||||
start_time = 0
|
||||
end_time = start_time + clip_length
|
||||
return
|
||||
start_time += movement_time
|
||||
end_time += movement_time
|
||||
|
||||
Reference in New Issue
Block a user