fix: wrap main canvas application around div to fix cursor problems

This commit is contained in:
trafficlunar 2025-10-08 17:22:26 +01:00
parent 0b6f044982
commit 2501adebd2

View file

@ -496,6 +496,9 @@ function Canvas() {
if (loading) return null;
return (
// Relative for canvas information
<div className="relative">
{/* Wrap application around div to use events */}
<div
ref={stageContainerRef}
tabIndex={0}
@ -507,7 +510,7 @@ function Canvas() {
onPointerUp={onPointerUp}
onWheel={onWheel}
style={{ cursor: cssCursor }}
className="relative"
className="size-full"
>
<Application resizeTo={stageContainerRef} ref={appRef} backgroundAlpha={0} className="touch-none select-none">
<Blocks blocks={visibleBlocks} missingTexture={missingTexture} textures={textures} coords={coords} scale={scale} version={version} />
@ -534,6 +537,7 @@ function Canvas() {
</pixiContainer>
)}
</Application>
</div>
<CursorInformation mouseCoords={mouseCoords} />
<CanvasInformation />