comparison 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
comparison
equal deleted inserted replaced
856:a6e17a5a39e7 860:238693c3bc51
31 { 31 {
32 const PolylineSceneLayer& layer = GetLayer<PolylineSceneLayer>(); 32 const PolylineSceneLayer& layer = GetLayer<PolylineSceneLayer>();
33 33
34 cairo_t* cr = GetCairoContext(); 34 cairo_t* cr = GetCairoContext();
35 35
36 cairo_set_source_rgb(cr, layer.GetRedAsFloat(), layer.GetGreenAsFloat(), layer.GetBlueAsFloat());
37 cairo_set_line_width(cr, layer.GetThickness()); 36 cairo_set_line_width(cr, layer.GetThickness());
38 37
39 for (size_t i = 0; i < layer.GetChainsCount(); i++) 38 for (size_t i = 0; i < layer.GetChainsCount(); i++)
40 { 39 {
40 const Color& color = layer.GetColor(i);
41 cairo_set_source_rgb(cr, color.GetRedAsFloat(),
42 color.GetGreenAsFloat(),
43 color.GetBlueAsFloat());
44
41 const PolylineSceneLayer::Chain& chain = layer.GetChain(i); 45 const PolylineSceneLayer::Chain& chain = layer.GetChain(i);
42 46
43 if (!chain.empty()) 47 if (!chain.empty())
44 { 48 {
45 for (size_t j = 0; j < chain.size(); j++) 49 for (size_t j = 0; j < chain.size(); j++)
60 { 64 {
61 ScenePoint2D p = chain[0].Apply(transform); 65 ScenePoint2D p = chain[0].Apply(transform);
62 cairo_line_to(cr, p.GetX(), p.GetY()); 66 cairo_line_to(cr, p.GetX(), p.GetY());
63 } 67 }
64 } 68 }
69
70 cairo_stroke(cr);
65 } 71 }
66
67 cairo_stroke(cr);
68 } 72 }
69 } 73 }
70 } 74 }