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
|
||||
var difference = Math.clamp(offset[0] / Timeline.vue._data.size, -256, 256);
|
||||
let [min, max] = dragging_range;
|
||||
|
||||
if (time_stretching) {
|
||||
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);
|
||||
let difference = 0;
|
||||
let max, min;
|
||||
if ((!e2.ctrlOrCmd && !e2.shiftKey) || time_stretching || !Timeline.vue.graph_editor_open) {
|
||||
difference = Math.clamp(offset[0] / Timeline.vue._data.size, -256, 256);
|
||||
[min, max] = dragging_range;
|
||||
|
||||
if (time_stretching) {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user