Skip to content

🎥 Make videos programmatically with React

awesome

Jonny Burgere372ccf57158
diff --git a/packages/convert/app/components/timing-editor/CheckboxWithLabel.tsx b/packages/convert/app/components/timing-editor/CheckboxWithLabel.tsx
index b5e1061604..5150f671df 100644
--- a/packages/convert/app/components/timing-editor/CheckboxWithLabel.tsx
+++ b/packages/convert/app/components/timing-editor/CheckboxWithLabel.tsx
@@ -15,9 +15,10 @@ export const CheckboxWithLabel: React.FC<{
readonly id: string;
readonly onCheckedChange: (checked: boolean) => void;
readonly checked: boolean;
-}> = ({id, checked, onCheckedChange}) => {
+ readonly className?: string;
+}> = ({id, checked, onCheckedChange, className}) => {
return (
- <div style={row}>
+ <div style={row} className={className}>
<Checkbox id={id} checked={checked} onCheckedChange={onCheckedChange} />
<Spacing x={1} />
<Label htmlFor={id}>
diff --git a/packages/convert/app/components/timing-editor/SpringEditor.tsx b/packages/convert/app/components/timing-editor/SpringEditor.tsx
index cfc7436c21..e158f1e3cd 100644
--- a/packages/convert/app/components/timing-editor/SpringEditor.tsx
+++ b/packages/convert/app/components/timing-editor/SpringEditor.tsx
@@ -91,9 +91,7 @@ export const SpringEditor: React.FC<{
min={0.02}
max={3.33}
step={0.01}
- value={[
- (config.durationInFrames ?? calculatedDurationInFrames) / 60,
- ]}
+ value={[(config.durationInFrames ?? calculatedDurationInFrames) / 60]}
style={{opacity: config.durationInFrames === null ? 0.5 : 1}}
onValueChange={(val) => {
onDragChange({
@@ -125,6 +123,7 @@ export const SpringEditor: React.FC<{
<CheckboxWithLabel
checked={config.springConfig.overshootClamping}
id="overshootClamping"
+ className="-mt-5"
onCheckedChange={(checked) => {
onChange({
...config,
diff --git a/packages/convert/app/components/timing-editor/draw.ts b/packages/convert/app/components/timing-editor/draw.ts
index c4d154cdc8..931815d6f0 100644
--- a/packages/convert/app/components/timing-editor/draw.ts
+++ b/packages/convert/app/components/timing-editor/draw.ts
@@ -149,7 +149,7 @@ export const draw = ({
const lineEndX = isMin ? shortLineEndX : fullLineEndX;
// Draw the line
- context.lineWidth = 1 * window.devicePixelRatio;
+ context.lineWidth = 1 * Number(window.devicePixelRatio);
context.beginPath();
context.moveTo(PADDING_LEFT, y);
context.lineTo(lineEndX, y);
@@ -176,13 +176,13 @@ export const draw = ({
drawAxisLine(min, true);
}
- // Draw 0 line if it's within range but not already drawn as min or max
- if (min < 0 && max > 0) {
+ // Draw 0 line if it's within range and not too close to min
+ if (min < 0 && max > 0 && (min < -0.1 || min > 0.1)) {
drawAxisLine(0, false);
}
- // Draw 1 line if it's within range but not already drawn as min or max
- if (min < 1 && max > 1) {
+ // Draw 1 line if it's within range and not too close to max
+ if (min < 1 && max > 1 && (max < 0.9 || max > 1.1)) {
drawAxisLine(1, false);
}