File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -2186,15 +2186,23 @@ class TPadPainter extends ObjectPainter {
21862186 btns . remove ( ) ;
21872187 }
21882188
2189- const main = pp . getFramePainter ( ) ;
2190- if ( ! isFunc ( main ?. render3D ) || ! isFunc ( main ?. access3dKind ) ) return ;
2189+ const fp = pp . getFramePainter ( ) ;
2190+ if ( ! isFunc ( fp ?. access3dKind ) ) return ;
21912191
2192- const can3d = main . access3dKind ( ) ;
2192+ const can3d = fp . access3dKind ( ) ;
21932193 if ( ( can3d !== constants . Embed3D . Overlay ) && ( can3d !== constants . Embed3D . Embed ) ) return ;
21942194
2195- const sz2 = main . getSizeFor3d ( constants . Embed3D . Embed ) , // get size and position of DOM element as it will be embed
2195+ let main , canvas ;
2196+ if ( isFunc ( fp . render3D ) ) {
2197+ main = fp ;
2198+ canvas = fp . renderer ?. domElement ;
2199+ } else {
2200+ main = fp . getMainPainter ( ) ;
2201+ canvas = main ?. _renderer ?. domElement ;
2202+ }
2203+ if ( ! isFunc ( main ?. render3D ) || ! isObject ( canvas ) ) return ;
21962204
2197- canvas = main . renderer . domElement ;
2205+ const sz2 = fp . getSizeFor3d ( constants . Embed3D . Embed ) ; // get size and position of DOM element as it will be embed
21982206 main . render3D ( 0 ) ; // WebGL clears buffers, therefore we should render scene and convert immediately
21992207 const dataUrl = canvas . toDataURL ( 'image/png' ) ;
22002208
You can’t perform that action at this time.
0 commit comments