File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
www/src/components/editor Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ export default function ZoomableSVGWrapper({
2828 } ;
2929
3030 updateDimensions ( ) ;
31- window . addEventListener ( "resize" , updateDimensions ) ;
32- return ( ) => window . removeEventListener ( "resize" , updateDimensions ) ;
3331 } , [ ] ) ;
3432
3533 // Fit SVG to screen on mount
3634 useEffect ( ( ) => {
37- if ( Viewer . current ) {
38- Viewer . current . fitToViewer ( ) ;
35+ if ( Viewer . current && dimensions . width > 0 && dimensions . height > 0 ) {
36+ requestAnimationFrame ( ( ) => {
37+ Viewer . current ! . fitToViewer ( ) ;
38+ } ) ;
3939 }
4040 } , [ dimensions ] ) ;
4141
@@ -46,13 +46,14 @@ export default function ZoomableSVGWrapper({
4646 width = { dimensions . width }
4747 height = { dimensions . height }
4848 background = { "#FFFFFF" }
49- scaleFactorMin = { 2 }
49+ scaleFactorMin = { 1 }
5050 scaleFactorMax = { 10 }
5151 tool = { TOOL_AUTO }
5252 ref = { Viewer }
5353 detectAutoPan = { false }
5454 onChangeValue = { ( ) => { } }
5555 onChangeTool = { ( ) => { } }
56+ toolbarProps = { { position : "none" } }
5657 detectWheel = { true }
5758 >
5859 { children }
You can’t perform that action at this time.
0 commit comments