mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-29 09:08:58 +00:00
snap keyframes
This commit is contained in:
@@ -240,8 +240,9 @@ export class AnimTimelineElement extends LitElement {
|
|||||||
let relativeX = event.clientX - elementBounds.left;
|
let relativeX = event.clientX - elementBounds.left;
|
||||||
let ratioX = Math.max(0, Math.min(relativeX / elementBounds.width, 1));
|
let ratioX = Math.max(0, Math.min(relativeX / elementBounds.width, 1));
|
||||||
const time = (this.rangeEnd - this.rangeStart) * ratioX + this.rangeStart;
|
const time = (this.rangeEnd - this.rangeStart) * ratioX + this.rangeStart;
|
||||||
|
const final_time = Math.round(time * this.clipFps) / this.clipFps;
|
||||||
|
|
||||||
studio.moveKeyframeTime(id, time);
|
studio.moveKeyframeTime(id, final_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateRenderWidth(): void {
|
updateRenderWidth(): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user