Skip to content

Commit b6d92e4

Browse files
committed
fix hotspot transparent
1 parent e5c7ffc commit b6d92e4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/abstract-3d/src/renderers/react/react-hotspot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function ReactHotSpot({
100100
})}
101101
>
102102
<ReactMesh mesh={h.mesh}>
103-
<ReactMaterial id={h.id} isText={false} material={h.mesh.material} hoveredId={hoveredId} />
103+
<ReactMaterial id={h.id} isText={false} isHotSpot={true} material={h.mesh.material} hoveredId={hoveredId} />
104104
</ReactMesh>
105105
</group>
106106
{hotSpotTexts && text && (

packages/abstract-3d/src/renderers/react/react-material.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export function ReactMaterial({
1818
materialStateImages,
1919
state,
2020
isText,
21+
isHotSpot,
2122
}: {
2223
readonly material: Material;
2324
readonly id?: string;
@@ -27,6 +28,7 @@ export function ReactMaterial({
2728
readonly materialStateImages?: Record<string, string>;
2829
readonly state?: MaterialState | undefined;
2930
readonly isText: boolean;
31+
readonly isHotSpot?: boolean;
3032
}): React.JSX.Element {
3133
const mat =
3234
!state || material.image?.type === "UrlImage"
@@ -70,7 +72,7 @@ export function ReactMaterial({
7072
roughness={mat.roughness}
7173
metalness={mat.metalness}
7274
side={DoubleSide}
73-
{...(opacity < 1 || disabled
75+
{...((opacity < 1 || disabled) && !isHotSpot
7476
? { transparent: true, opacity: disabled ? opacity * decreasedOpacity : opacity }
7577
: materialDefaults)}
7678
/>

0 commit comments

Comments
 (0)