diff Framework/Scene2D/Internals/CairoPolylineRenderer.cpp @ 860:238693c3bc51 am-dev

merge default -> am-dev
author Alain Mazy <alain@mazy.be>
date Mon, 24 Jun 2019 14:35:00 +0200
parents 61ba4b504e9a
children 6e888cf6a48b
line wrap: on
line diff
--- a/Framework/Scene2D/Internals/CairoPolylineRenderer.cpp	Wed Jun 19 17:36:33 2019 +0200
+++ b/Framework/Scene2D/Internals/CairoPolylineRenderer.cpp	Mon Jun 24 14:35:00 2019 +0200
@@ -33,11 +33,15 @@
       
       cairo_t* cr = GetCairoContext();
 
-      cairo_set_source_rgb(cr, layer.GetRedAsFloat(), layer.GetGreenAsFloat(), layer.GetBlueAsFloat());
       cairo_set_line_width(cr, layer.GetThickness());
       
       for (size_t i = 0; i < layer.GetChainsCount(); i++)
       {
+        const Color& color = layer.GetColor(i);
+        cairo_set_source_rgb(cr, color.GetRedAsFloat(),
+                             color.GetGreenAsFloat(),
+                             color.GetBlueAsFloat());
+
         const PolylineSceneLayer::Chain& chain = layer.GetChain(i);
 
         if (!chain.empty())
@@ -62,9 +66,9 @@
             cairo_line_to(cr, p.GetX(), p.GetY());
           }
         }
+
+        cairo_stroke(cr);
       }
-
-      cairo_stroke(cr);
     }
   }
 }