Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

Make webcam rounding proportional and shadows stronger

younge824a164eac6
diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx
index 1f998e98..b3c4037d 100644
--- a/src/components/video-editor/SettingsPanel.tsx
+++ b/src/components/video-editor/SettingsPanel.tsx
@@ -77,12 +77,12 @@ import {
DEFAULT_CURSOR_STYLE,
DEFAULT_CURSOR_SWAY,
DEFAULT_PADDING,
- DEFAULT_WEBCAM_CORNER_RADIUS,
DEFAULT_WEBCAM_MARGIN,
DEFAULT_WEBCAM_POSITION_PRESET,
DEFAULT_WEBCAM_POSITION_X,
DEFAULT_WEBCAM_POSITION_Y,
DEFAULT_WEBCAM_REACT_TO_ZOOM,
+ DEFAULT_WEBCAM_ROUNDNESS,
DEFAULT_WEBCAM_SHADOW,
DEFAULT_WEBCAM_SIZE,
DEFAULT_ZOOM_IN_DURATION_MS,
@@ -3658,14 +3658,14 @@ export function SettingsPanel({
/>
<SliderControl
label={tSettings("effects.webcamRoundness")}
- value={webcam?.cornerRadius ?? DEFAULT_WEBCAM_CORNER_RADIUS}
- defaultValue={DEFAULT_WEBCAM_CORNER_RADIUS}
+ value={webcam?.roundness ?? DEFAULT_WEBCAM_ROUNDNESS}
+ defaultValue={DEFAULT_WEBCAM_ROUNDNESS}
min={0}
- max={160}
+ max={100}
step={1}
- onChange={(v) => updateWebcam({ cornerRadius: v })}
- formatValue={(v) => `${Math.round(v)}px`}
- parseInput={(text) => parseFloat(text.replace(/px$/, ""))}
+ onChange={(v) => updateWebcam({ roundness: v })}
+ formatValue={(v) => `${Math.round(v)}%`}
+ parseInput={(text) => parseFloat(text.replace(/%$/, ""))}
/>
<SliderControl
label={tSettings("effects.webcamShadow")}
diff --git a/src/components/video-editor/VideoPlayback.tsx b/src/components/video-editor/VideoPlayback.tsx
index 86b40054..db7e33c4 100644
--- a/src/components/video-editor/VideoPlayback.tsx
+++ b/src/components/video-editor/VideoPlayback.tsx
@@ -12,7 +12,10 @@ import {
useState,
} from "react";
import { getAssetPath, getRenderableAssetUrl, getRenderableVideoUrl } from "@/lib/assetPath";
-import { WEBCAM_SHADOW_LAYER_PROFILES } from "@/lib/exporter/shadowProfile";
+import {
+ getWebcamShadowStrength,
+ WEBCAM_SHADOW_LAYER_PROFILES,
+} from "@/lib/exporter/shadowProfile";
import {
clampMediaTimeToDuration,
enablePitchPreservingPlayback,
@@ -90,8 +93,8 @@ import {
DEFAULT_CURSOR_STYLE,
DEFAULT_CURSOR_SWAY,
DEFAULT_PADDING,
- DEFAULT_WEBCAM_CORNER_RADIUS,
DEFAULT_WEBCAM_REACT_TO_ZOOM,
+ DEFAULT_WEBCAM_ROUNDNESS,
DEFAULT_WEBCAM_SHADOW,
DEFAULT_WEBCAM_SIZE,
DEFAULT_ZOOM_IN_DURATION_MS,
@@ -124,6 +127,7 @@ import {
} from "./videoPlayback/zoomTransform";
import {
getCropMatchedWebcamHeightPercent,
+ getWebcamCornerRadiusPx,
getWebcamCropSourceRect,
getWebcamOverlayDimensionsPx,
getWebcamOverlayPosition,
@@ -793,8 +797,9 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
const webcamPositionX = webcam?.positionX ?? 1;
const webcamPositionY = webcam?.positionY ?? 1;
const webcamCorner = webcam?.corner ?? "bottom-right";
- const webcamCornerRadius = webcam?.cornerRadius ?? DEFAULT_WEBCAM_CORNER_RADIUS;
+ const webcamRoundness = webcam?.roundness ?? DEFAULT_WEBCAM_ROUNDNESS;
const webcamShadow = webcam?.shadow ?? DEFAULT_WEBCAM_SHADOW;
+ const webcamShadowStrength = getWebcamShadowStrength(webcamShadow);
const webcamShadowProfile = WEBCAM_SHADOW_LAYER_PROFILES[0];
const webcamTimeOffsetMs = webcam?.timeOffsetMs;
const webcamCropRegion = webcam?.cropRegion;
@@ -845,10 +850,6 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
return;
}
const scaledMargin = scaleWebcamOverlayPixels(webcamMargin, overlay.clientWidth);
- const scaledRadius = scaleWebcamOverlayPixels(
- webcamCornerRadius,
- overlay.clientWidth,
- );
const scaledDimensions = getWebcamOverlayDimensionsPx({
containerWidth: overlay.clientWidth,
@@ -859,6 +860,11 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
zoomScale,
reactToZoom: webcamReactToZoom,
});
+ const scaledRadius = getWebcamCornerRadiusPx(
+ webcamRoundness,
+ scaledDimensions.width,
+ scaledDimensions.height,
+ );
const { x, y } = getWebcamOverlayPosition({
containerWidth: overlay.clientWidth,
containerHeight: overlay.clientHeight,
@@ -885,11 +891,13 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
radius: scaledRadius,
});
const shadowSize = Math.min(scaledDimensions.width, scaledDimensions.height);
- const shadowOffset = shadowSize * webcamShadowProfile.offsetScale * webcamShadow;
- const shadowBlur = shadowSize * webcamShadowProfile.blurScale * webcamShadow;
- const shadowAlpha = webcamShadowProfile.alphaScale * webcamShadow;
+ const shadowOffset =
+ shadowSize * webcamShadowProfile.offsetScale * webcamShadowStrength;
+ const shadowBlur =
+ shadowSize * webcamShadowProfile.blurScale * webcamShadowStrength;
+ const shadowAlpha = webcamShadowProfile.alphaScale * webcamShadowStrength;
bubble.style.filter =
- webcamShadow > 0
+ webcamShadowStrength > 0
? `drop-shadow(0 ${shadowOffset}px ${shadowBlur}px rgba(0, 0, 0, ${shadowAlpha}))`
: "none";
bubble.style.borderRadius = "0px";
@@ -903,14 +911,14 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
},
[
webcamCorner,
- webcamCornerRadius,
+ webcamRoundness,
webcamEnabled,
webcamMargin,
webcamPositionPreset,
webcamPositionX,
webcamPositionY,
webcamReactToZoom,
- webcamShadow,
+ webcamShadowStrength,
webcamHeight,
webcamVideoPath,
webcamWidth,
diff --git a/src/components/video-editor/projectPersistence.test.ts b/src/components/video-editor/projectPersistence.test.ts
index 575c3b67..6054f9e8 100644
--- a/src/components/video-editor/projectPersistence.test.ts
+++ b/src/components/video-editor/projectPersistence.test.ts
@@ -43,4 +43,17 @@ describe("normalizeProjectEditor", () => {
linked: true,
});
});
+
+ it("migrates legacy webcam radius pixels to percentage roundness", () => {
+ const editor = normalizeProjectEditor({
+ webcam: {
+ cornerRadius: 90,
+ width: 40,
+ height: 40,
+ } as never,
+ });
+
+ expect(editor.webcam.roundness).toBeCloseTo(41.67, 1);
+ expect(editor.webcam.cornerRadius).toBeUndefined();
+ });
});
diff --git a/src/components/video-editor/projectPersistence.ts b/src/components/video-editor/projectPersistence.ts
index 93292297..788f9693 100644
--- a/src/components/video-editor/projectPersistence.ts
+++ b/src/components/video-editor/projectPersistence.ts
@@ -52,13 +52,13 @@ import {
DEFAULT_FIGURE_DATA,
DEFAULT_PADDING,
DEFAULT_PLAYBACK_SPEED,
- DEFAULT_WEBCAM_CORNER_RADIUS,
DEFAULT_WEBCAM_MARGIN,
DEFAULT_WEBCAM_OVERLAY,
DEFAULT_WEBCAM_POSITION_PRESET,
DEFAULT_WEBCAM_POSITION_X,
DEFAULT_WEBCAM_POSITION_Y,
DEFAULT_WEBCAM_REACT_TO_ZOOM,
+ DEFAULT_WEBCAM_ROUNDNESS,
DEFAULT_WEBCAM_SHADOW,
DEFAULT_WEBCAM_SIZE,
DEFAULT_WEBCAM_TIME_OFFSET_MS,
@@ -80,7 +80,7 @@ import {
type ZoomRegion,
type ZoomTransitionEasing,
} from "./types";
-import { normalizeWebcamCropRegion } from "./webcamOverlay";
+import { convertLegacyWebcamRadiusToRoundness, normalizeWebcamCropRegion } from "./webcamOverlay";
export const PROJECT_VERSION = 1;
@@ -1047,9 +1047,15 @@ export function normalizeProjectEditor(editor: Partial<ProjectEditorState>): Pro
: legacyZoomScaleEffect != null
? legacyZoomScaleEffect > 0
: DEFAULT_WEBCAM_REACT_TO_ZOOM,
- cornerRadius: isFiniteNumber(webcam.cornerRadius)
- ? clamp(webcam.cornerRadius, 0, 160)
- : DEFAULT_WEBCAM_CORNER_RADIUS,
+ roundness: isFiniteNumber(webcam.roundness)
+ ? clamp(webcam.roundness, 0, 100)
+ : isFiniteNumber(webcam.cornerRadius)
+ ? convertLegacyWebcamRadiusToRoundness(
+ webcam.cornerRadius,
+ isFiniteNumber(webcam.width) ? webcam.width : DEFAULT_WEBCAM_SIZE,
+ isFiniteNumber(webcam.height) ? webcam.height : DEFAULT_WEBCAM_SIZE,
+ )
+ : DEFAULT_WEBCAM_ROUNDNESS,
shadow: isFiniteNumber(webcam.shadow)
? clamp(webcam.shadow, 0, 1)
: DEFAULT_WEBCAM_SHADOW,
diff --git a/src/components/video-editor/types.ts b/src/components/video-editor/types.ts
index 0b75c0e4..7ffff4a2 100644
--- a/src/components/video-editor/types.ts
+++ b/src/components/video-editor/types.ts
@@ -147,7 +147,9 @@ export interface WebcamOverlaySettings {
width: number;
height: number;
reactToZoom: boolean;
- cornerRadius: number;
+ roundness: number;
+ /** Legacy pixel value retained only while loading older projects. */
+ cornerRadius?: number;
shadow: number;
margin: number;
}
@@ -189,7 +191,7 @@ export const DEFAULT_ZOOM_OUT_EASING: ZoomTransitionEasing = "recordly";
export const DEFAULT_CONNECTED_ZOOM_EASING: ZoomTransitionEasing = "glide";
export const DEFAULT_WEBCAM_SIZE = 40;
export const DEFAULT_WEBCAM_REACT_TO_ZOOM = true;
-export const DEFAULT_WEBCAM_CORNER_RADIUS = 90;
+export const DEFAULT_WEBCAM_ROUNDNESS = 42;
export const DEFAULT_WEBCAM_SHADOW = 0.67;
export const DEFAULT_WEBCAM_MARGIN = 24;
export const DEFAULT_WEBCAM_POSITION_PRESET: WebcamPositionPreset = "bottom-right";
@@ -211,7 +213,7 @@ export const DEFAULT_WEBCAM_OVERLAY: WebcamOverlaySettings = {
width: DEFAULT_WEBCAM_SIZE,
height: DEFAULT_WEBCAM_SIZE,
reactToZoom: DEFAULT_WEBCAM_REACT_TO_ZOOM,
- cornerRadius: DEFAULT_WEBCAM_CORNER_RADIUS,
+ roundness: DEFAULT_WEBCAM_ROUNDNESS,
shadow: DEFAULT_WEBCAM_SHADOW,
margin: DEFAULT_WEBCAM_MARGIN,
};
diff --git a/src/components/video-editor/webcamOverlay.test.ts b/src/components/video-editor/webcamOverlay.test.ts
index 701d6a71..502739ab 100644
--- a/src/components/video-editor/webcamOverlay.test.ts
+++ b/src/components/video-editor/webcamOverlay.test.ts
@@ -1,6 +1,8 @@
import { describe, expect, it } from "vitest";
import {
+ convertLegacyWebcamRadiusToRoundness,
getCropMatchedWebcamHeightPercent,
+ getWebcamCornerRadiusPx,
getWebcamCropSourceRect,
getWebcamOverlayDimensionsPx,
getWebcamOverlayPosition,
@@ -9,6 +11,18 @@ import {
scaleWebcamOverlayPixels,
} from "./webcamOverlay";
+describe("webcam roundness", () => {
+ it("uses a percentage of the maximum radius", () => {
+ expect(getWebcamCornerRadiusPx(0, 640, 360)).toBe(0);
+ expect(getWebcamCornerRadiusPx(50, 640, 360)).toBe(90);
+ expect(getWebcamCornerRadiusPx(100, 640, 360)).toBe(180);
+ });
+
+ it("converts legacy reference pixels without changing the approximate shape", () => {
+ expect(convertLegacyWebcamRadiusToRoundness(90, 40, 40)).toBeCloseTo(41.67, 1);
+ });
+});
+
describe("scaleWebcamOverlayPixels", () => {
it("keeps webcam pixel controls proportional between preview and export", () => {
expect(scaleWebcamOverlayPixels(24, 960)).toBe(12);
diff --git a/src/components/video-editor/webcamOverlay.ts b/src/components/video-editor/webcamOverlay.ts
index 342415d9..ae8603c5 100644
--- a/src/components/video-editor/webcamOverlay.ts
+++ b/src/components/video-editor/webcamOverlay.ts
@@ -2,6 +2,7 @@ import type { CropRegion, WebcamCorner, WebcamPositionPreset } from "./types";
const MIN_WEBCAM_OVERLAY_SIZE_PX = 56;
export const WEBCAM_REFERENCE_VIEWPORT_WIDTH = 1920;
+const WEBCAM_REFERENCE_VIEWPORT_HEIGHT = 1080;
function clamp(value: number, min: number, max: number) {
return Math.min(max, Math.max(min, value));
@@ -13,6 +14,26 @@ export function scaleWebcamOverlayPixels(value: number, containerWidth: number):
return safeValue * (safeWidth / WEBCAM_REFERENCE_VIEWPORT_WIDTH);
}
+export function getWebcamCornerRadiusPx(
+ roundnessPercent: number,
+ width: number,
+ height: number,
+): number {
+ const safeRoundness = Number.isFinite(roundnessPercent) ? clamp(roundnessPercent, 0, 100) : 0;
+ return (Math.max(0, Math.min(width, height)) / 2) * (safeRoundness / 100);
+}
+
+export function convertLegacyWebcamRadiusToRoundness(
+ radiusPixels: number,
+ widthPercent: number,
+ heightPercent: number,
+): number {
+ const referenceShortSide =
+ WEBCAM_REFERENCE_VIEWPORT_HEIGHT *
+ (clamp(Math.min(widthPercent, heightPercent), 10, 100) / 100);
+ return clamp((Math.max(0, radiusPixels) / (referenceShortSide / 2)) * 100, 0, 100);
+}
+
export function getWebcamPositionForPreset(preset: WebcamPositionPreset): { x: number; y: number } {
switch (preset) {
case "top-left":
diff --git a/src/lib/exporter/frameRenderer.ts b/src/lib/exporter/frameRenderer.ts
index 2ae00875..81ce6dae 100644
--- a/src/lib/exporter/frameRenderer.ts
+++ b/src/lib/exporter/frameRenderer.ts
@@ -19,6 +19,7 @@ import type {
import {
BASE_PREVIEW_HEIGHT,
BASE_PREVIEW_WIDTH,
+ DEFAULT_WEBCAM_ROUNDNESS,
ZOOM_DEPTH_SCALES,
} from "@/components/video-editor/types";
import { DEFAULT_FOCUS } from "@/components/video-editor/videoPlayback/constants";
@@ -51,12 +52,14 @@ import {
} from "@/components/video-editor/videoPlayback/zoomTransform";
import {
getCropMatchedWebcamHeightPercent,
+ getWebcamCornerRadiusPx,
getWebcamCropSourceRect,
getWebcamOverlayDimensionsPx,
getWebcamOverlayPosition,
scaleWebcamOverlayPixels,
} from "@/components/video-editor/webcamOverlay";
import { getAssetPath, getExportableVideoUrl, getRenderableAssetUrl } from "@/lib/assetPath";
+import { getWebcamShadowStrength } from "@/lib/exporter/shadowProfile";
import { drawSquircleOnCanvas, drawSquircleOnGraphics } from "@/lib/geometry/squircle";
import {
clampMediaTimeToDuration,
@@ -2097,7 +2100,11 @@ export class FrameRenderer {
positionY: webcam.positionY ?? 1,
legacyCorner: webcam.corner,
});
- const radius = scaleWebcamOverlayPixels(webcam.cornerRadius ?? 18, width);
+ const radius = getWebcamCornerRadiusPx(
+ webcam.roundness ?? DEFAULT_WEBCAM_ROUNDNESS,
+ dimensions.width,
+ dimensions.height,
+ );
const bubbleWidth = Math.max(1, Math.ceil(dimensions.width));
const bubbleHeight = Math.max(1, Math.ceil(dimensions.height));
if (bubbleCanvas.width !== bubbleWidth || bubbleCanvas.height !== bubbleHeight) {
@@ -2159,7 +2166,7 @@ export class FrameRenderer {
bubbleCtx.restore();
if ((webcam.shadow ?? 0) > 0) {
- const shadow = Math.max(0, Math.min(1, webcam.shadow));
+ const shadow = getWebcamShadowStrength(webcam.shadow);
const shadowSize = Math.min(dimensions.width, dimensions.height);
ctx.save();
ctx.filter = `drop-shadow(0 ${Math.round(shadowSize * 0.06)}px ${Math.round(shadowSize * 0.22)}px rgba(0,0,0,${shadow}))`;
diff --git a/src/lib/exporter/modernFrameRenderer.ts b/src/lib/exporter/modernFrameRenderer.ts
index 5be35b8a..fa0778ae 100644
--- a/src/lib/exporter/modernFrameRenderer.ts
+++ b/src/lib/exporter/modernFrameRenderer.ts
@@ -26,7 +26,11 @@ import type {
ZoomRegion,
ZoomTransitionEasing,
} from "@/components/video-editor/types";
-import { getDefaultCaptionFontFamily, ZOOM_DEPTH_SCALES } from "@/components/video-editor/types";
+import {
+ DEFAULT_WEBCAM_ROUNDNESS,
+ getDefaultCaptionFontFamily,
+ ZOOM_DEPTH_SCALES,
+} from "@/components/video-editor/types";
import { DEFAULT_FOCUS } from "@/components/video-editor/videoPlayback/constants";
import {
type CursorFollowCameraState,
@@ -60,6 +64,7 @@ import {
} from "@/components/video-editor/videoPlayback/zoomTransform";
import {
getCropMatchedWebcamHeightPercent,
+ getWebcamCornerRadiusPx,
getWebcamCropSourceRect,
getWebcamOverlayDimensionsPx,
getWebcamOverlayPosition,
@@ -87,6 +92,7 @@ import { ForwardFrameSource } from "./forwardFrameSource";
import { resolveMediaElementSource } from "./localMediaSource";
import {
getShadowFilterPadding,
+ getWebcamShadowStrength,
VIDEO_SHADOW_LAYER_PROFILES,
WEBCAM_SHADOW_LAYER_PROFILES,
} from "./shadowProfile";
@@ -2863,8 +2869,12 @@ export class FrameRenderer {
positionY: webcam.positionY ?? 1,
legacyCorner: webcam.corner,
});
- const radius = scaleWebcamOverlayPixels(webcam.cornerRadius ?? 18, this.config.width);
- const shadowStrength = clampUnitInterval(webcam.shadow ?? 0);
+ const radius = getWebcamCornerRadiusPx(
+ webcam.roundness ?? DEFAULT_WEBCAM_ROUNDNESS,
+ dimensions.width,
+ dimensions.height,
+ );
+ const shadowStrength = getWebcamShadowStrength(webcam.shadow ?? 0);
this.webcamRootContainer.visible = true;
diff --git a/src/lib/exporter/modernVideoExporter.ts b/src/lib/exporter/modernVideoExporter.ts
index 258b205f..35f185de 100644
--- a/src/lib/exporter/modernVideoExporter.ts
+++ b/src/lib/exporter/modernVideoExporter.ts
@@ -17,7 +17,7 @@ import type {
ZoomRegion,
ZoomTransitionEasing,
} from "@/components/video-editor/types";
-import { ZOOM_DEPTH_SCALES } from "@/components/video-editor/types";
+import { DEFAULT_WEBCAM_ROUNDNESS, ZOOM_DEPTH_SCALES } from "@/components/video-editor/types";
import { DEFAULT_FOCUS } from "@/components/video-editor/videoPlayback/constants";
import {
computeCursorFollowFocus,
@@ -40,6 +40,7 @@ import { getCursorStyleSizeMultiplier } from "@/components/video-editor/videoPla
import { findDominantRegion } from "@/components/video-editor/videoPlayback/zoomRegionUtils";
import { computeZoomTransform } from "@/components/video-editor/videoPlayback/zoomTransform";
import {
+ getWebcamCornerRadiusPx,
getWebcamOverlayPosition,
getWebcamOverlaySizePx,
isWebcamCropRegionDefault,
@@ -80,6 +81,7 @@ import {
import { VideoMuxer } from "./muxer";
import { roundNativeStaticLayoutContentSize } from "./nativeStaticLayoutGeometry";
import { buildNativeStaticLayoutCursorTelemetry } from "./nativeStaticLayoutTelemetry";
+import { getWebcamShadowStrength } from "./shadowProfile";
import { resolveSourceAudioFallbackPaths } from "./sourceAudioFallback";
import { type DecodedVideoInfo, StreamingVideoDecoder } from "./streamingDecoder";
import type {
@@ -2052,8 +2054,12 @@ export class ModernVideoExporter {
left: Math.round(position.x),
top: Math.round(position.y),
size,
- radius: Math.max(0, webcam.cornerRadius ?? 18),
- shadowIntensity: Math.min(1, Math.max(0, webcam.shadow ?? 0)),
+ radius: getWebcamCornerRadiusPx(
+ webcam.roundness ?? DEFAULT_WEBCAM_ROUNDNESS,
+ size,
+ size,
+ ),
+ shadowIntensity: getWebcamShadowStrength(webcam.shadow ?? 0),
mirror: webcam.mirror !== false,
timeOffsetMs: Number.isFinite(webcam.timeOffsetMs) ? webcam.timeOffsetMs : 0,
};
diff --git a/src/lib/exporter/shadowProfile.test.ts b/src/lib/exporter/shadowProfile.test.ts
new file mode 100644
index 00000000..04849de0
--- /dev/null
+++ b/src/lib/exporter/shadowProfile.test.ts
@@ -0,0 +1,11 @@
+import { describe, expect, it } from "vitest";
+import { getWebcamShadowStrength } from "./shadowProfile";
+
+describe("getWebcamShadowStrength", () => {
+ it("doubles the webcam shadow response and clamps it", () => {
+ expect(getWebcamShadowStrength(0)).toBe(0);
+ expect(getWebcamShadowStrength(0.25)).toBe(0.5);
+ expect(getWebcamShadowStrength(0.5)).toBe(1);
+ expect(getWebcamShadowStrength(1)).toBe(1);
+ });
+});
diff --git a/src/lib/exporter/shadowProfile.ts b/src/lib/exporter/shadowProfile.ts
index 61f55536..9117eb77 100644
--- a/src/lib/exporter/shadowProfile.ts
+++ b/src/lib/exporter/shadowProfile.ts
@@ -14,6 +14,10 @@ export const WEBCAM_SHADOW_LAYER_PROFILES: ReadonlyArray<ShadowLayerProfile> = O
{ offsetScale: 0.06, alphaScale: 1, blurScale: 0.22 },
]);
+export function getWebcamShadowStrength(value: number): number {
+ return Math.min(1, Math.max(0, Number.isFinite(value) ? value * 2 : 0));
+}
+
export function getShadowFilterPadding(blur: number, offsetY: number): number {
return Math.ceil(Math.max(0, blur * 2 + Math.abs(offsetY)));
}