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

@@ -5,15 +5,15 @@
<title>LottieFiles Preview</title>
<style>
html, body {
width: 100%;
height:100%;
margin: 0;
overflow: hidden;
width: 100%;
height:100%;
margin: 0;
overflow: hidden;
}
#bm {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
</style>
</head>

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();