From 00d5b9a5686394051ed15e9f7f229d1585de3ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Vovk?= Date: Thu, 9 Jan 2025 23:16:04 +0100 Subject: [PATCH] Fixed isolation style placement for inverted mask --- zpl2svg.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zpl2svg.js b/zpl2svg.js index 0cf03e3..f020368 100644 --- a/zpl2svg.js +++ b/zpl2svg.js @@ -260,7 +260,7 @@ // YYYY-MM-DD HH:MM:SS const timestamp = new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '') - svg.push(``) + svg.push(``) // svg.push(``) svg.push(` `) @@ -273,7 +273,7 @@ svg.push(` `) svg.push(` `) - svg.push(` `) + svg.push(` `) for (let i = 0; i < lines.length; i++) { @@ -900,7 +900,9 @@ const imageLoader = getImageLoader() // Gets a new Image element from browser or node-canvas from Node.js const ctx = canvas.getContext('2d'); if (!ctx) throw new Error('Failed to get 2d context') - const image = await imageLoader(`data:image/svg+xml;base64,${btoa(svg)}`) + const svg_base64 = `data:image/svg+xml;base64,${btoa(svg)}` + // console.log(`svg_base64:`, svg_base64) + const image = await imageLoader(svg_base64) canvas.width = image.width canvas.height = image.height ctx.drawImage(image, 0, 0)