summaryrefslogtreecommitdiffstats
path: root/thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp
diff options
context:
space:
mode:
authorMartin Capitanio <capnm@capitanio.org>2024-02-02 12:38:09 +0100
committerMartin Capitanio <capnm@capitanio.org>2024-02-02 13:58:59 +0100
commitda42124efe4f04fbb2749a255af09118b5be6156 (patch)
tree0fa904fb7f072ea368f3eafd8f876b94f2db5d7c /thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp
parent10e111477db68fe65776a1d68fb1ffccaf6520fc (diff)
downloadredot-engine-da42124efe4f04fbb2749a255af09118b5be6156.tar.gz
ThorVG: update from v0.12.3 to v0.12.4
https://github.com/thorvg/thorvg/releases/tag/v0.12.4 + Full Changelog: https://github.com/thorvg/thorvg/compare/v0.12.3...v0.12.4 Godot-related SVG bug fixes: + loader/svg: Apply specification of out-of-range elliptical arc parameters, fix zero check of arc's rx and ry. thorvg/thorvg#1938
Diffstat (limited to 'thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp')
-rw-r--r--thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp b/thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp
index 45322c07b4..d3b715eab8 100644
--- a/thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp
+++ b/thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp
@@ -122,7 +122,9 @@ static void _dashLineTo(SwDashStroke& dash, const Point* to, const Matrix* trans
Line cur = {dash.ptCur, *to};
auto len = _lineLength(cur.pt1, cur.pt2);
- if (len < dash.curLen) {
+ if (mathZero(len)) {
+ _outlineMoveTo(*dash.outline, &dash.ptCur, transform);
+ } else if (len < dash.curLen) {
dash.curLen -= len;
if (!dash.curOpGap) {
if (dash.move) {
@@ -179,7 +181,9 @@ static void _dashCubicTo(SwDashStroke& dash, const Point* ctrl1, const Point* ct
Bezier cur = {dash.ptCur, *ctrl1, *ctrl2, *to};
auto len = bezLength(cur);
- if (len < dash.curLen) {
+ if (mathZero(len)) {
+ _outlineMoveTo(*dash.outline, &dash.ptCur, transform);
+ } else if (len < dash.curLen) {
dash.curLen -= len;
if (!dash.curOpGap) {
if (dash.move) {