Lock timeline axis when holding ctrl or shift

This commit is contained in:
JannisX11 2023-06-16 22:13:20 +02:00
parent 3608b2bfec
commit 6e5f81f112

View File

@ -1000,14 +1000,18 @@ Interface.definePanels(() => {
} }
// Time // Time
var difference = Math.clamp(offset[0] / Timeline.vue._data.size, -256, 256); let difference = 0;
let [min, max] = dragging_range; let max, min;
if ((!e2.ctrlOrCmd && !e2.shiftKey) || time_stretching || !Timeline.vue.graph_editor_open) {
if (time_stretching) { difference = Math.clamp(offset[0] / Timeline.vue._data.size, -256, 256);
var time_factor = (clicked && clicked.time_before < (min + max) / 2) [min, max] = dragging_range;
? ((max-min-difference) / (max-min))
: ((max-min+difference) / (max-min)); if (time_stretching) {
time_factor = Math.roundTo(time_factor, 2); var time_factor = (clicked && clicked.time_before < (min + max) / 2)
? ((max-min-difference) / (max-min))
: ((max-min+difference) / (max-min));
time_factor = Math.roundTo(time_factor, 2);
}
} }
// Value // Value