Skip to content

Commit c8f3542

Browse files
committed
fixed ui not zooming out
1 parent 6407073 commit c8f3542

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/pages/home/Home.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ export default function Home() {
1616
setIsVisible(true);
1717
};
1818

19+
const handleClose = () => {
20+
setIsVisible(false);
21+
zoomOutRef.current?.();
22+
};
23+
1924
useEffect(() => {
2025
if (!canvasRef.current) return;
2126
const { zoomOut } = main(canvasRef.current, handleOpen);
@@ -24,19 +29,13 @@ export default function Home() {
2429

2530
return (
2631
<div>
27-
<header>
28-
<div className={styles["header-brand"]}>
29-
<h1>glorpython</h1>
30-
</div>
31-
</header>
32-
3332
<section className="relative w-full h-screen">
3433
{isVisible && (
3534

3635
<div className="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-[90vw] h-[90vh] z-50">
3736
<LevelComponent
3837
key={mountKey}
39-
onClose={() => setIsVisible(false)}
38+
onClose={() => handleClose()}
4039
lvl={lvlNum}
4140
/>
4241
</div>

0 commit comments

Comments
 (0)