Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -269,15 +269,16 @@ function MeasurementOverlay() {
|
|||||||
<SnapRing position={[snapPoint.x, snapPoint.y, snapPoint.z]} />
|
<SnapRing position={[snapPoint.x, snapPoint.y, snapPoint.z]} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Hover auto-detect tooltip */}
|
{/* Hover auto-detect tooltip (works both inside and outside measure mode) */}
|
||||||
{hoverInfo && (
|
{hoverInfo && (
|
||||||
<MeasurementLabel
|
<MeasurementLabel
|
||||||
position={hoverInfo.position}
|
position={hoverInfo.position}
|
||||||
text={`${hoverInfo.type === 'hole' ? '⌀ ' : ''}${hoverInfo.value.toFixed(1)} mm`}
|
text={hoverInfo.type === 'hole'
|
||||||
variant="primary"
|
? `Ø ${hoverInfo.value.toFixed(1)}`
|
||||||
|
: `${hoverInfo.value.toFixed(1)} mm`}
|
||||||
|
variant={hoverInfo.type === 'hole' ? 'accent' : 'primary'}
|
||||||
fixed
|
fixed
|
||||||
/>
|
/>
|
||||||
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Pending first point */}
|
{/* Pending first point */}
|
||||||
@@ -295,6 +296,26 @@ function MeasurementOverlay() {
|
|||||||
(a[2] + b[2]) / 2,
|
(a[2] + b[2]) / 2,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (m.kind === 'hole') {
|
||||||
|
return (
|
||||||
|
<group key={m.id}>
|
||||||
|
<PointMarker position={a} color="#f59e0b" />
|
||||||
|
<MeasurementLabel position={a} text={m.label ?? `Ø ${m.distanceMM.toFixed(1)}`} variant="accent" />
|
||||||
|
</group>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m.kind === 'edge') {
|
||||||
|
return (
|
||||||
|
<group key={m.id}>
|
||||||
|
<PointMarker position={a} color="#22c55e" />
|
||||||
|
<PointMarker position={b} color="#22c55e" />
|
||||||
|
<Line points={[a, b]} color="#22c55e" lineWidth={2} depthTest={false} />
|
||||||
|
<MeasurementLabel position={mid} text={m.label ?? `${m.distanceMM.toFixed(1)} mm`} variant="success" />
|
||||||
|
</group>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<group key={m.id}>
|
<group key={m.id}>
|
||||||
<PointMarker position={a} color="#22c55e" />
|
<PointMarker position={a} color="#22c55e" />
|
||||||
|
|||||||
Reference in New Issue
Block a user