summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/SVGElement.cpp')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/SVGElement.cpp11
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());
}