diff options
Diffstat (limited to 'dviware/dvisvgm/src/SVGElement.cpp')
-rw-r--r-- | dviware/dvisvgm/src/SVGElement.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/dviware/dvisvgm/src/SVGElement.cpp b/dviware/dvisvgm/src/SVGElement.cpp index 68f7d2231c..b0f1db925c 100644 --- a/dviware/dvisvgm/src/SVGElement.cpp +++ b/dviware/dvisvgm/src/SVGElement.cpp @@ -27,6 +27,9 @@ using namespace std; +bool SVGElement::USE_CURRENTCOLOR=false; +Color SVGElement::CURRENTCOLOR; + void SVGElement::setClipPathUrl (const string &url) { if (!url.empty()) @@ -41,7 +44,9 @@ void SVGElement::setClipRule (FillRule rule) { void SVGElement::setFillColor (Color color, bool skipBlack) { - if (color != Color::BLACK || !skipBlack) + if (USE_CURRENTCOLOR && color == CURRENTCOLOR) + addAttribute("fill", "currentColor"); + else if (color != Color::BLACK || !skipBlack) addAttribute("fill", color.svgColorString()); } @@ -108,7 +113,7 @@ void SVGElement::setPoints (const vector<DPair> &points) { void SVGElement::setStrokeColor (Color color) { - addAttribute("stroke", color.svgColorString()); + addAttribute("stroke", USE_CURRENTCOLOR && color == CURRENTCOLOR ? "currentColor" : color.svgColorString()); } |