changeset 31192:7401a2501be4

maint: merge stable to default
author Rik <rik@octave.org>
date Mon, 15 Aug 2022 21:06:21 -0700
parents 9a0e3f0b3823 (current diff) bb9d776eafac (diff)
children e859837e620d
files
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/octave-svgconvert.cc	Mon Aug 15 12:44:17 2022 +0200
+++ b/src/octave-svgconvert.cc	Mon Aug 15 21:06:21 2022 -0700
@@ -660,12 +660,6 @@
         }
       else if (elt.tagName () == "rect")
         {
-          // Color
-          QColor col (Qt::black);
-          QString str = elt.attribute ("fill");
-          if (! str.isEmpty ())
-            col = QColor (str);
-
           // Position
           double x = elt.attribute ("x").toDouble ();
           double y = elt.attribute ("y").toDouble ();
@@ -674,10 +668,19 @@
           double wd = elt.attribute ("width").toDouble ();
           double hg = elt.attribute ("height").toDouble ();
 
-          painter.setBrush (col);
+          // Color
+          QColor saved_color = painter.brush ().color ();
+
+          QString str = elt.attribute ("fill");
+          if (! str.isEmpty ())
+            painter.setBrush (QColor (str));
+
           painter.setPen (Qt::NoPen);
 
           painter.drawRect (QRectF (x, y, wd, hg));
+
+          if (! str.isEmpty ())
+            painter.setBrush (saved_color);
         }
       else if (elt.tagName () == "polygon")
         {