Don't allow the length of a sequence to go below zero
Fixes THE-80
This commit is contained in:
parent
d0965d17e4
commit
cc9a65fbd8
1 changed files with 6 additions and 2 deletions
|
@ -36,7 +36,7 @@ import type {
|
|||
PanelPosition,
|
||||
StudioAhistoricState,
|
||||
} from './types'
|
||||
import {uniq} from 'lodash-es'
|
||||
import {clamp, uniq} from 'lodash-es'
|
||||
import {
|
||||
isProject,
|
||||
isSheet,
|
||||
|
@ -415,7 +415,11 @@ namespace stateEditors {
|
|||
export function setLength(
|
||||
p: WithoutSheetInstance<SheetAddress> & {length: number},
|
||||
) {
|
||||
_ensure(p).length = parseFloat(p.length.toFixed(2))
|
||||
_ensure(p).length = clamp(
|
||||
parseFloat(p.length.toFixed(2)),
|
||||
0.01,
|
||||
Infinity,
|
||||
)
|
||||
}
|
||||
|
||||
function _ensureTracksOfObject(
|
||||
|
|
Loading…
Reference in a new issue