From b58030a14fad882ed36e5a75461cf7307baa1718 Mon Sep 17 00:00:00 2001 From: gleamish Date: Sun, 3 Aug 2025 12:09:04 +0800 Subject: [PATCH] feat: set linewidth as multiple of dpr with sensible default width --- src/core/Line.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/Line.tsx b/src/core/Line.tsx index dd1d950..6b8fae7 100644 --- a/src/core/Line.tsx +++ b/src/core/Line.tsx @@ -81,6 +81,9 @@ export function Line(props: LineProps) { onCleanup(() => lineGeometry().dispose()) + const dpr = store.dpr ?? 1 + const lineWidth = dpr * (config.linewidth ?? config.lineWidth ?? 1) + return ( <> @@ -91,7 +94,7 @@ export function Line(props: LineProps) { color={config.color} vertexColors={Boolean(config.vertexColors)} resolution={[store.bounds.width, store.bounds.height]} - linewidth={config.linewidth ?? config.lineWidth} + linewidth={lineWidth} dashed={config.dashed} {...rest} />