mirror of
https://github.com/mii443/obsidian-typst.git
synced 2025-08-23 00:25:43 +00:00
fix: canvas duplication (#26)
This commit is contained in:
@ -31,7 +31,7 @@ export default class TypstRenderElement extends HTMLElement {
|
|||||||
// this.style.height = TypstRenderElement.prevHeight;
|
// this.style.height = TypstRenderElement.prevHeight;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (this.format == "image") {
|
if (this.format == "image" && this.canvas == undefined) {
|
||||||
this.canvas = this.appendChild(createEl("canvas", { attr: { height: TypstRenderElement.prevHeight }, cls: "typst-doc" }))
|
this.canvas = this.appendChild(createEl("canvas", { attr: { height: TypstRenderElement.prevHeight }, cls: "typst-doc" }))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,4 +131,4 @@ export default class TypstRenderElement extends HTMLElement {
|
|||||||
ctx.imageSmoothingQuality = "high"
|
ctx.imageSmoothingQuality = "high"
|
||||||
ctx.putImageData(image, 0, 0);
|
ctx.putImageData(image, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user