Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Parker-Stafford committed Apr 30, 2024
1 parent d7798c4 commit f7aa871
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Points.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,26 +208,26 @@ export function Points({
<instancedMesh
args={[undefined, undefined, data.length]}
ref={meshRef}
onPointerUp={e => {
onPointerUp={(e) => {
if (e.intersections) {
const instanceIds = e.intersections
.map(e => e?.instanceId)
.map((e) => e?.instanceId)
.filter((i): i is NonNullable<typeof i> => i != null);

// Multi click
onPointsClicked &&
onPointsClicked(instanceIds.map(i => data[i]));
onPointsClicked(instanceIds.map((i) => data[i]));

// Single click
instanceIds.length > 0 &&
onPointClicked &&
onPointClicked(data[instanceIds[0]]);
}
}}
onPointerOver={e => {
onPointerOver={(e) => {
if (e.intersections) {
const instanceIds = e.intersections
.map(e => e?.instanceId)
.map((e) => e?.instanceId)
.filter((i): i is NonNullable<typeof i> => i != null);

// Single instance callback
Expand Down

0 comments on commit f7aa871

Please sign in to comment.