From 4de379d884dbcb574b06e2ba10da20bf4e56d7f4 Mon Sep 17 00:00:00 2001 From: plc-user <74435298+plc-user@users.noreply.github.com> Date: Wed, 27 Mar 2024 20:13:35 +0100 Subject: [PATCH] fix: no hardcoded colors for SVG-background --- sources/exportdialog.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sources/exportdialog.cpp b/sources/exportdialog.cpp index 357a91be4..04ea815e6 100644 --- a/sources/exportdialog.cpp +++ b/sources/exportdialog.cpp @@ -400,11 +400,15 @@ void ExportDialog::generateSvg( { saveReloadDiagramParameters(diagram, true); - // FIXME: This is a Quick-and-Dirty-Hack to achieve transparency in SVG-Background: + // set the transparency for the SVG-Background: + int iRed = 254; + int iGreen = 253; + int iBlue = 252; + diagram->background_color.getRgb(&iRed, &iGreen, &iBlue); if (epw->exportProperties().draw_bg_transparent == true) { - diagram->background_color = QColor(255, 255, 255, 0); + diagram->background_color = QColor(iRed, iGreen, iBlue, 0); } else { - diagram->background_color = QColor(255, 255, 255, 255); + diagram->background_color = QColor(iRed, iGreen, iBlue, 255); } // genere une QPicture a partir du schema