All keyframe operations now snap to the frame grid
This commit is contained in:
parent
2ec6a54060
commit
d46e0bfd2f
8 changed files with 51 additions and 17 deletions
|
@ -97,11 +97,13 @@ export default class Sequence {
|
|||
return this.closestGridPosition(this.position)
|
||||
}
|
||||
|
||||
closestGridPosition(posInUnitSpace: number): number {
|
||||
closestGridPosition = (posInUnitSpace: number): number => {
|
||||
const subUnitsPerUnit = this.subUnitsPerUnit
|
||||
const gridLength = 1 / subUnitsPerUnit
|
||||
|
||||
return Math.round(posInUnitSpace / gridLength) * gridLength
|
||||
return parseFloat(
|
||||
(Math.round(posInUnitSpace / gridLength) * gridLength).toFixed(3),
|
||||
)
|
||||
}
|
||||
|
||||
set position(requestedPosition: number) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue