File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
editor/src/editor/layout/preview Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,13 @@ export function EditorPreviewCamera(props: IEditorPreviewCameraProps) {
2121 const canvas = canvasRef . current ! ;
2222 const engine = props . editor . layout . preview . engine ;
2323
24- engine . registerView ( canvas , props . camera ) ;
24+ const mainCanvas = engine . getRenderingCanvas ( ) ! ;
25+
26+ const view = engine . registerView ( canvas , props . camera ) ;
27+ view . customResize = ( canvas ) => {
28+ canvas . width = mainCanvas . width ;
29+ canvas . height = mainCanvas . height ;
30+ } ;
2531
2632 return ( ) => {
2733 engine . unRegisterView ( canvas ) ;
@@ -36,7 +42,7 @@ export function EditorPreviewCamera(props: IEditorPreviewCameraProps) {
3642 < AiOutlineClose />
3743 </ Button >
3844 </ div >
39- < canvas ref = { canvasRef } className = "w-full h-full bg-black" />
45+ < canvas ref = { canvasRef } className = "w-full h-full object-contain bg-black" />
4046 </ div >
4147 ) ;
4248}
You can’t perform that action at this time.
0 commit comments