From 57d32d431f3e68dcb299aa4a57f54cfb2fb80c87 Mon Sep 17 00:00:00 2001 From: Quentin Bolsee <quentinbolsee@hotmail.com> Date: Wed, 11 Oct 2023 19:10:54 -0400 Subject: [PATCH] Invert if BW --- src/interface.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/interface.js b/src/interface.js index b595357..816546a 100644 --- a/src/interface.js +++ b/src/interface.js @@ -162,7 +162,11 @@ function updateSVG(fromSettingsChange=false) { globalXMLRoot.setAttribute("height", `${(vb[3]/1000).toFixed(3)}mm`); if (!globalSettings.transparent) { let backgroundElem = globalXMLRoot.ownerDocument.createElement("rect"); - backgroundElem.setAttribute("fill", "rgb(255,255,255)"); + if (globalSettings.blackAndWhite) { + backgroundElem.setAttribute("fill", "rgb(0,0,0)"); + } else { + backgroundElem.setAttribute("fill", "rgb(255,255,255)"); + } backgroundElem.setAttribute("x", vb[0]); backgroundElem.setAttribute("y", vb[1]); backgroundElem.setAttribute("width", vb[2]); @@ -191,8 +195,8 @@ function updateSVG(fromSettingsChange=false) { // let ty = Number(m[1]) + (layerVB[3]-(yMax-yMin))/2; if (globalSettings.blackAndWhite) { g.setAttribute("opacity", 1.0); - g.setAttribute("fill", "rgb(0,0,0)"); - g.setAttribute("stroke", "rgb(0,0,0)"); + g.setAttribute("fill", "rgb(255,255,255)"); + g.setAttribute("stroke", "rgb(255,255,255)"); } else { g.setAttribute("opacity", layerOpacity); g.setAttribute("fill", layerRGB); -- GitLab