diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-03-06 23:15:59 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-03-06 23:15:59 -0500 |
commit | 2a6fc5af74aefa8ede6fd566e866fdb4a6655da8 (patch) | |
tree | 534619796d5f2340696faefd6d7c16c997fb01ba /libs/canvas/polygon.cc | |
parent | feebabb330d9d61105b71bbac4d43b0f14454621 (diff) |
tweak Polygon::render() to work whether or not fill or outline are unset
Diffstat (limited to 'libs/canvas/polygon.cc')
-rw-r--r-- | libs/canvas/polygon.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libs/canvas/polygon.cc b/libs/canvas/polygon.cc index 2e81823616..9352e900e9 100644 --- a/libs/canvas/polygon.cc +++ b/libs/canvas/polygon.cc @@ -41,8 +41,7 @@ Polygon::~Polygon () void Polygon::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const { - if (_outline) { - setup_outline_context (context); + if (_outline || _fill) { render_path (area, context); if (!_points.empty ()) { @@ -51,7 +50,15 @@ Polygon::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const context->move_to (p.x, p.y); } - context->stroke_preserve (); + } + + if (_outline) { + setup_outline_context (context); + if (_fill) { + context->stroke_preserve (); + } else { + context->stroke (); + } } if (_fill) { |