aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2021-05-23 18:24:55 +0200
committerlonkaars <loek@pipeframe.xyz>2021-05-23 18:24:55 +0200
commitefe8ae1933f74a0f37e22110eaa1e5dca99463cd (patch)
tree46c28b1a288ecc657f0eff7517133c9085d3b32c
parent33b33dd282d67d1adc603a749c7116bbdaff589f (diff)
no loop begin/end wobble
-rw-r--r--pages/editor.tsx4
-rw-r--r--styles/keyframes.css2
2 files changed, 3 insertions, 3 deletions
diff --git a/pages/editor.tsx b/pages/editor.tsx
index 2a1dbef..9bf8391 100644
--- a/pages/editor.tsx
+++ b/pages/editor.tsx
@@ -92,7 +92,7 @@ function TimelineKeyframe(props: {
<div className='keyframeWrapper posabs abscenterh'>
{props.slide.type == 'loop'
? <div
- style={{ '--loop-length': spring.frame.toJSON() - spring.begin.toJSON() } as CSSProperties}
+ style={{ '--begin': spring.begin.toJSON() } as CSSProperties}
className='loop'
>
<span className='dispinbl start' ref={loopStartRef}>
@@ -182,7 +182,7 @@ function TimelineEditor(props: {
}
if (drawFrame) {
- ctx.fillRect(rect[0], rect[1], rect[2], rect[3]);
+ ctx.fillRect(Math.round(rect[0]), Math.round(rect[1]), Math.round(rect[2]), Math.round(rect[3]));
if (marker) {
var frame = Math.round(x / frameWidth + offset / frameWidth + 1);
diff --git a/styles/keyframes.css b/styles/keyframes.css
index 53fba20..750c7ba 100644
--- a/styles/keyframes.css
+++ b/styles/keyframes.css
@@ -7,7 +7,7 @@
}
.loop {
- width: calc(var(--loop-length) * var(--zoom) * 1px + 24px);
+ width: calc((var(--frame) - var(--begin)) * var(--zoom) * 1px + 24px);
position: absolute;
right: 0;
}