Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -228,11 +228,19 @@ function useLabelDistanceFactor(position: [number, number, number]): number {
|
|||||||
return ref.current;
|
return ref.current;
|
||||||
}
|
}
|
||||||
|
|
||||||
function MeasurementLabel({ position, text, variant, fixed = false }: { position: [number, number, number]; text: string; variant: 'success' | 'primary'; fixed?: boolean }) {
|
function MeasurementLabel({ position, text, variant, fixed = false }: { position: [number, number, number]; text: string; variant: 'success' | 'primary' | 'accent'; fixed?: boolean }) {
|
||||||
const dfDynamic = useLabelDistanceFactor(position);
|
const dfDynamic = useLabelDistanceFactor(position);
|
||||||
const df = fixed ? dfDynamic : 1.5;
|
const df = fixed ? dfDynamic : 1.5;
|
||||||
const borderClass = variant === 'success' ? 'border-success/60' : 'border-primary/60';
|
const borderClass = variant === 'success'
|
||||||
const textClass = variant === 'success' ? 'text-success' : 'text-primary';
|
? 'border-success/60'
|
||||||
|
: variant === 'accent'
|
||||||
|
? 'border-amber-400/70'
|
||||||
|
: 'border-primary/60';
|
||||||
|
const textClass = variant === 'success'
|
||||||
|
? 'text-success'
|
||||||
|
: variant === 'accent'
|
||||||
|
? 'text-amber-400'
|
||||||
|
: 'text-primary';
|
||||||
return (
|
return (
|
||||||
<Html position={position} center distanceFactor={df} zIndexRange={[100, 0]} style={{ pointerEvents: 'none' }}>
|
<Html position={position} center distanceFactor={df} zIndexRange={[100, 0]} style={{ pointerEvents: 'none' }}>
|
||||||
<div className={`rounded bg-card/95 border ${borderClass} px-2 py-0.5 shadow-lg backdrop-blur-sm`}>
|
<div className={`rounded bg-card/95 border ${borderClass} px-2 py-0.5 shadow-lg backdrop-blur-sm`}>
|
||||||
|
|||||||
Reference in New Issue
Block a user