mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
Lock timeline axis when holding ctrl or shift
This commit is contained in:
parent
3608b2bfec
commit
6e5f81f112
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user