fix fill outline color

This commit is contained in:
Konstantin Käfer
2014-06-26 15:32:18 +02:00
parent 99d939b9a6
commit 084c938e54
3 changed files with 9 additions and 6 deletions

View File

@@ -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<float, 2> translate = {{ 0, 0 }};
TranslateAnchorType translateAnchor = TranslateAnchorType::Default;
std::string image;

View File

@@ -96,4 +96,3 @@ private:
}
#endif
¯

View File

@@ -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;