Fix/0.5-compatability-tests (#293)

* Working changes

* Fix window undefined bug by updating lib

* Fix TransformControlsImpl import

* Fix compatibility tests>simple debuggable examples
This commit is contained in:
Elliot 2022-09-13 15:37:39 -04:00 committed by GitHub
parent 494c60d0c3
commit 735bd983a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 572 additions and 574 deletions

View file

@ -99,7 +99,8 @@ const ReferenceWindow: VFC<ReferenceWindowProps> = ({
const [width, height] = useMemo(() => {
if (!gl) return [0, 0]
const aspectRatio = origWidth / origHeight
const aspectRatio =
origWidth / (origHeight || Number.EPSILON) || Number.EPSILON
const width = Math.min(aspectRatio * maxHeight, maxWidth)

View file

@ -2,7 +2,7 @@ import type {Object3D, Event} from 'three'
import React, {forwardRef, useLayoutEffect, useEffect, useMemo} from 'react'
import type {ReactThreeFiber, Overwrite} from '@react-three/fiber'
import {useThree} from '@react-three/fiber'
import {TransformControls as TransformControlsImpl} from 'three/examples/jsm/controls/TransformControls'
import {TransformControls as TransformControlsImpl} from 'three-stdlib'
import type {OrbitControls} from 'three-stdlib'
type R3fTransformControls = Overwrite<
@ -18,6 +18,10 @@ export interface TransformControlsProps extends R3fTransformControls {
orbitControlsRef?: React.MutableRefObject<OrbitControls | null>
onObjectChange?: (event: Event) => void
onDraggingChange?: (event: Event) => void
// not a complete list of props that transform controls can take
mode: TransformControlsImpl['mode']
space: TransformControlsImpl['space']
}
const TransformControls = forwardRef(