From 084c938e541fcc4edcf219bb9cdabc523f402db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 26 Jun 2014 15:32:18 +0200 Subject: [PATCH] fix fill outline color --- include/llmr/style/properties.hpp | 2 +- include/llmr/style/style.hpp | 1 - src/renderer/painter_fill.cpp | 12 ++++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/llmr/style/properties.hpp b/include/llmr/style/properties.hpp index 644fd34cc..8deff16c0 100644 --- a/include/llmr/style/properties.hpp +++ b/include/llmr/style/properties.hpp @@ -226,7 +226,7 @@ struct FillProperties { bool antialias = true; float opacity = 1.0f; Color fill_color = {{ 0, 0, 0, 1 }}; - Color stroke_color = {{ 0, 0, 0, 1 }}; + Color stroke_color = {{ 0, 0, 0, -1 }}; std::array translate = {{ 0, 0 }}; TranslateAnchorType translateAnchor = TranslateAnchorType::Default; std::string image; diff --git a/include/llmr/style/style.hpp b/include/llmr/style/style.hpp index bc3605737..b9f221b2d 100644 --- a/include/llmr/style/style.hpp +++ b/include/llmr/style/style.hpp @@ -96,4 +96,3 @@ private: } #endif -¯ \ No newline at end of file diff --git a/src/renderer/painter_fill.cpp b/src/renderer/painter_fill.cpp index 4628db7f7..fa79cb8de 100644 --- a/src/renderer/painter_fill.cpp +++ b/src/renderer/painter_fill.cpp @@ -17,10 +17,14 @@ void Painter::renderFill(FillBucket& bucket, const FillProperties& properties, c fill_color[3] *= properties.opacity; Color stroke_color = properties.stroke_color; - stroke_color[0] *= properties.opacity; - stroke_color[1] *= properties.opacity; - stroke_color[2] *= properties.opacity; - stroke_color[3] *= properties.opacity; + if (stroke_color[3] < 0) { + stroke_color = fill_color; + } else { + stroke_color[0] *= properties.opacity; + stroke_color[1] *= properties.opacity; + stroke_color[2] *= properties.opacity; + stroke_color[3] *= properties.opacity; + } bool outline = properties.antialias && properties.stroke_color != properties.fill_color; bool fringeline = properties.antialias && properties.stroke_color == properties.fill_color;