Skip to content

Commit

Permalink
fix(Svg): patch for three r152 (#2061)
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoHamuy authored Aug 7, 2024
1 parent 4d69df7 commit 9f9b268
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/Svg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export const Svg: ForwardRefComponent<SvgProps, Object3D> = /* @__PURE__ */ forw
return () => strokeGeometries.forEach((group) => group && group.map((g) => g.dispose()))
}, [strokeGeometries])

let renderOrder = 0

return (
<object3D ref={ref} {...props}>
<object3D scale={[1, -1, 1]}>
Expand All @@ -48,7 +50,7 @@ export const Svg: ForwardRefComponent<SvgProps, Object3D> = /* @__PURE__ */ forw
path.userData?.style.fill !== undefined &&
path.userData.style.fill !== 'none' &&
SVGLoader.createShapes(path).map((shape, s) => (
<mesh key={s} {...fillMeshProps}>
<mesh key={s} {...fillMeshProps} renderOrder={renderOrder++}>
<shapeGeometry args={[shape]} />
<meshBasicMaterial
color={path.userData!.style.fill}
Expand All @@ -64,7 +66,7 @@ export const Svg: ForwardRefComponent<SvgProps, Object3D> = /* @__PURE__ */ forw
path.userData?.style.stroke !== undefined &&
path.userData.style.stroke !== 'none' &&
path.subPaths.map((_subPath, s) => (
<mesh key={s} geometry={strokeGeometries[p]![s]} {...strokeMeshProps}>
<mesh key={s} geometry={strokeGeometries[p]![s]} {...strokeMeshProps} renderOrder={renderOrder++}>
<meshBasicMaterial
color={path.userData!.style.stroke}
opacity={path.userData!.style.strokeOpacity}
Expand Down

0 comments on commit 9f9b268

Please sign in to comment.