Skip to content

Commit

Permalink
fix: box3
Browse files Browse the repository at this point in the history
  • Loading branch information
drcmda committed May 12, 2023
1 parent 939cd49 commit 69592f1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/core/Resize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ export const Resize = React.forwardRef<THREE.Group, ResizeProps>(

React.useLayoutEffect(() => {
outer.current.matrixWorld.identity()

box3 ||= new THREE.Box3().setFromObject(inner.current, precise)
const w = box3.max.x - box3.min.x
const h = box3.max.y - box3.min.y
const d = box3.max.z - box3.min.z
let box = box3 || new THREE.Box3().setFromObject(inner.current, precise)
const w = box.max.x - box.min.x
const h = box.max.y - box.min.y
const d = box.max.z - box.min.z

let dimension = Math.max(w, h, d)
if (width) dimension = w
Expand Down

1 comment on commit 69592f1

@vercel
Copy link

@vercel vercel bot commented on 69592f1 May 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.