Rename SvgViewer.init to render and update usage

This commit is contained in:
ema
2025-07-05 09:31:57 +08:00
parent a14b22d762
commit 007b960019
2 changed files with 10 additions and 10 deletions

View File

@@ -242,10 +242,10 @@ class SvgViewer {
}
/**
* Initialize SVG viewer.
* Render SVG file.
* @async
*/
async init() {
async render() {
const rawSvg = await chrome.webview.hostObjects.external.GetSvgContent();
const parser = new DOMParser();
const doc = parser.parseFromString(rawSvg, 'image/svg+xml');
@@ -263,5 +263,5 @@ class SvgViewer {
}
}
// Create and initialize the SVG viewer
new SvgViewer().init();
// Create the SVG viewer and render
new SvgViewer().render();