diff options
author | Karl Berry <karl@freefriends.org> | 2024-01-16 18:32:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-01-16 18:32:08 +0000 |
commit | 84b532c711d3e644d6ba05e8118356310fd68fbf (patch) | |
tree | 33d34c031bb6342b29a3801d2cc1f9208f637920 /Build/source/texk/dvisvgm/dvisvgm-src/src/SVGElement.cpp | |
parent | 32d816973b284f3e5a0bd28a7ad5ef73e3102b34 (diff) |
dvisvgm 3.2
git-svn-id: svn://tug.org/texlive/trunk@69453 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/SVGElement.cpp')
-rw-r--r-- | Build/source/texk/dvisvgm/dvisvgm-src/src/SVGElement.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGElement.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGElement.cpp index 68f7d2231c6..9664e892807 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGElement.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGElement.cpp @@ -2,7 +2,7 @@ ** SVGElement.cpp ** ** ** ** This file is part of dvisvgm -- a fast DVI to SVG converter ** -** Copyright (C) 2005-2023 Martin Gieseking <martin.gieseking@uos.de> ** +** Copyright (C) 2005-2024 Martin Gieseking <martin.gieseking@uos.de> ** ** ** ** This program is free software; you can redistribute it and/or ** ** modify it under the terms of the GNU General Public License as ** @@ -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()); } |