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

@@ -81,6 +81,7 @@ All notable changes to this project will be documented in this file.
- [#2471] SVG Export - exporting with font-face - text tags with multiple texts,
fix invalid family names, incorrect text size
- Replacing existing characters in a font which has character codes unsorted
- [#2475] SVG Import - ignoring gradients caused by missing offset attribute of stop element
## [23.0.1] - 2025-05-16
### Fixed
@@ -3886,6 +3887,7 @@ Major version of SWF to XML export changed to 2.
[#1646]: https://www.free-decompiler.com/flash/issues/1646
[#2469]: https://www.free-decompiler.com/flash/issues/2469
[#2471]: https://www.free-decompiler.com/flash/issues/2471
[#2475]: https://www.free-decompiler.com/flash/issues/2475
[#2427]: https://www.free-decompiler.com/flash/issues/2427
[#1826]: https://www.free-decompiler.com/flash/issues/1826
[#2448]: https://www.free-decompiler.com/flash/issues/2448

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;