fix: RoomRenderable

This commit is contained in:
cha0s 2022-04-03 12:02:02 -05:00
parent 61b978aaaa
commit 5d62fdd1f9
2 changed files with 17 additions and 1 deletions

View File

@ -18,7 +18,7 @@ const RoomStage = () => {
setCamera(selfEntity.camera); setCamera(selfEntity.camera);
} }
}, [selfEntity]); }, [selfEntity]);
return <RoomRenderable camera={camera} className={styles.stage} room={room} />; return <RoomRenderable camera={camera} styles={styles} room={room} />;
}; };
export default RoomStage; export default RoomStage;

View File

@ -1,8 +1,13 @@
.stage { .stage {
display: inline-block;
left: 50%; left: 50%;
line-height: 0;
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
canvas {
image-rendering: pixelated;
}
@media (max-aspect-ratio: 16/9) { @media (max-aspect-ratio: 16/9) {
&, &,
& > [class], & > [class],
@ -18,3 +23,14 @@
} }
} }
} }
.canvas {
align-items: center;
display: flex;
flex-grow: 1;
height: 100%;
justify-content: space-around;
position: relative;
width: 100%;
line-height: 0;
}