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:
parent
494c60d0c3
commit
735bd983a5
24 changed files with 572 additions and 574 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue