()
| 63 | }; |
| 64 | |
| 65 | private updateOriginViewBox() { |
| 66 | const svg = this.editor.getDocument(); |
| 67 | // In Node env or before render, fallback to current viewBox attribute |
| 68 | if (!svg.getBBox) { |
| 69 | this.originViewBox = viewBoxToString(getViewBox(svg)); |
| 70 | return; |
| 71 | } |
| 72 | |
| 73 | // In Browser, calculate fit |
| 74 | const { padding } = this.state.getOptions(); |
| 75 | this.originViewBox = getBoundViewBox(svg, parsePadding(padding)); |
| 76 | } |
| 77 | |
| 78 | private handleViewBoxChange = (viewBox?: string) => { |
| 79 | const svg = this.editor.getDocument(); |
no test coverage detected