File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,15 @@ export const CadViewer = forwardRef<
4646 const board = su ( circuitJson as any ) . pcb_board . list ( ) [ 0 ]
4747 if ( ! board ) return [ 5 , 5 , 5 ] as const
4848 const { width, height } = board
49- const largestDim = Math . max ( width , height )
49+
50+ if ( ! width && ! height ) {
51+ return [ 5 , 5 , 5 ] as const
52+ }
53+
54+ const minCameraDistance = 5
55+ const adjustedBoardWidth = Math . max ( width , minCameraDistance )
56+ const adjustedBoardHeight = Math . max ( height , minCameraDistance )
57+ const largestDim = Math . max ( adjustedBoardWidth , adjustedBoardHeight )
5058 return [ largestDim / 2 , largestDim / 2 , largestDim ] as const
5159 } catch ( e ) {
5260 console . error ( e )
Original file line number Diff line number Diff line change 1+ import { CadViewer } from "src/CadViewer"
2+
3+ export const EmptyBoard = ( ) => {
4+ return (
5+ < CadViewer >
6+ < board width = "0" height = "0" > </ board >
7+ </ CadViewer >
8+ )
9+ }
10+
11+ export default {
12+ title : "EmptyBoard" ,
13+ component : EmptyBoard ,
14+ }
You can’t perform that action at this time.
0 commit comments