fix: better stroke width and color for edges
This commit is contained in:
@@ -6,10 +6,13 @@
|
|||||||
toneMapped: false,
|
toneMapped: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let lineColor = $state(colors.edge.clone().convertSRGBToLinear());
|
||||||
|
|
||||||
$effect.root(() => {
|
$effect.root(() => {
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
appSettings.value.theme;
|
appSettings.value.theme;
|
||||||
circleMaterial.color = colors.edge.clone().convertSRGBToLinear();
|
circleMaterial.color = colors.edge.clone().convertSRGBToLinear();
|
||||||
|
lineColor = colors.edge.clone().convertSRGBToLinear();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -38,11 +41,9 @@
|
|||||||
|
|
||||||
const { from, to, z }: Props = $props();
|
const { from, to, z }: Props = $props();
|
||||||
|
|
||||||
let mesh = $state<Mesh>();
|
const thickness = $derived(Math.max(0.001, 0.00082 * Math.exp(0.055 * z)));
|
||||||
|
|
||||||
const lineColor = $derived(
|
let mesh = $state<Mesh>();
|
||||||
appSettings.value.theme && colors.edge.clone().convertSRGBToLinear(),
|
|
||||||
);
|
|
||||||
|
|
||||||
let lastId: number | null = null;
|
let lastId: number | null = null;
|
||||||
|
|
||||||
@@ -111,5 +112,5 @@
|
|||||||
position.z={from.y}
|
position.z={from.y}
|
||||||
position.y={0.1}
|
position.y={0.1}
|
||||||
>
|
>
|
||||||
<MeshLineMaterial width={Math.max(z * 0.00012, 0.00003)} color={lineColor} />
|
<MeshLineMaterial width={thickness} color={lineColor} />
|
||||||
</T.Mesh>
|
</T.Mesh>
|
||||||
|
|||||||
Reference in New Issue
Block a user