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