Skip to content

Commit

Permalink
Fix invisible object selection
Browse files Browse the repository at this point in the history
adeira-source-id: 16117f1a852b2fdf32c4d9e0068cb5142a0de924
  • Loading branch information
itsdouges authored and triplex-bot committed Aug 5, 2024
1 parent 091aa04 commit 89bd69b
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-rabbits-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@triplex/renderer-r3f": patch
---

Invisible scene objects can no longer be selected in the scene.
5 changes: 5 additions & 0 deletions .changeset/dirty-snails-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@triplex/renderer-r3f": patch
---

You can now unselect by clicking on empty space.
11 changes: 11 additions & 0 deletions examples/test-fixture/src/third-party.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Copyright (c) Michael Dougall. All rights reserved.
*
* This source code is licensed under the GPL-3.0 license found in the LICENSE
* file in the root directory of this source tree.
*/
import { Box } from "@react-three/drei";

export const ThirdParty = () => {
return <Box />;
};
19 changes: 10 additions & 9 deletions examples/test-fixture/src/uikit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
* This source code is licensed under the GPL-3.0 license found in the LICENSE
* file in the root directory of this source tree.
*/
import { Container, Fullscreen } from "@react-three/uikit";
import { Container, Portal, Root } from "@react-three/uikit";

export function UIKitExample() {
return (
<Fullscreen flexDirection="row" gap={100} padding={100}>
<Container
backgroundColor="red"
backgroundOpacity={0.5}
flexGrow={1}
hover={{ backgroundOpacity: 1 }}
/>
</Fullscreen>
<Root>
<Container>
<Portal height={200} width={200}>
<mesh>
<boxGeometry />
</mesh>
</Portal>
</Container>
</Root>
);
}
33 changes: 33 additions & 0 deletions examples/test-fixture/src/visibility.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright (c) Michael Dougall. All rights reserved.
*
* This source code is licensed under the GPL-3.0 license found in the LICENSE
* file in the root directory of this source tree.
*/
export function InvisibleMesh() {
return (
<>
<mesh name={"visible"} position={[0, 0, -1.2]} scale={[3.66, 3.04, 1]}>
<boxGeometry />
</mesh>
<mesh name={"invisible"} visible={false}>
<boxGeometry />
</mesh>
</>
);
}

export function InvisibleParent() {
return (
<>
<mesh name={"visible"} position={[0, 0, -1.2]} scale={[3.66, 3.04, 1]}>
<boxGeometry />
</mesh>
<group visible={false}>
<mesh name={"invisible"}>
<boxGeometry />
</mesh>
</group>
</>
);
}
2 changes: 1 addition & 1 deletion examples/test-fixture/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "es2022"],
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "Bundler",
"noEmit": true,
"paths": {
"@/*": ["./src/*"]
Expand Down

0 comments on commit 89bd69b

Please sign in to comment.