修改截图样式不全问题

This commit is contained in:
guanj
2025-10-22 08:50:42 +08:00
parent 78a4b1685c
commit e10b451e68
4 changed files with 85 additions and 37 deletions

View File

@@ -10,6 +10,7 @@ export const useGenThumbnail = async (canvas_id: string = 'mtCanvasArea') => {
// //记录要移除的svg元素
const shouldRemoveSvgNodes = []
// 获取到所有的SVG 得到一个数组 目前只有自定义连线需要特殊处理 别的元素直接使用html2canvas就可以
const svgElements: NodeListOf<HTMLElement> = document.body.querySelectorAll(`#${canvas_id} .mt-line-render`)
// 遍历这个数组
for (const item of svgElements) {
@@ -40,13 +41,14 @@ export const useGenThumbnail = async (canvas_id: string = 'mtCanvasArea') => {
const width = el.offsetWidth
const height = el.offsetHeight
const canvas = await html2canvas(el, {
useCORS: true,
scale: 2,
width,
height,
// width,
// height,
allowTaint: true,
windowHeight: height,
// windowHeight: height,
logging: false,
ignoreElements: element => {
if (element.classList.contains('mt-line-render')) {