Fixed: #2475 SVG Import - ignoring gradients caused by missing offset attribute of stop element

This commit is contained in:
Jindra Petřík
2025-06-24 19:58:39 +02:00
parent 35b0cebdd6
commit ae690486ee
2 changed files with 6 additions and 2 deletions

View File

@@ -557,8 +557,10 @@ class SvgStyle {
Element stopEl = (Element) node;
SvgStyle newStyle = new SvgStyle(importer, idMap, stopEl, cachedBitmaps);
String offsetStr = stopEl.getAttribute("offset");
double offset = importer.parseNumberOrPercent(offsetStr);
double offset = 0;
if (stopEl.hasAttribute("offset")) {
offset = importer.parseNumberOrPercent(stopEl.getAttribute("offset"));
}
Color color = newStyle.getStopColor();
if (color == null) {
color = Color.BLACK;