summaryrefslogtreecommitdiffstats
path: root/thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-03-09 23:58:59 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-03-09 23:58:59 +0100
commit6fa77e0f1442328a969c9ad0651047fae34f72a3 (patch)
treeadbcdca713d10d162423970a36a3ea6e57298789 /thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp
parent0ace0a129284ffc6646b199699c1607a316fcec0 (diff)
downloadredot-engine-6fa77e0f1442328a969c9ad0651047fae34f72a3.tar.gz
thorvg: Update to 0.12.7
Diffstat (limited to 'thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp')
-rw-r--r--thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp b/thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp
index d3b715eab8..03261a4b7f 100644
--- a/thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp
+++ b/thirdparty/thorvg/src/renderer/sw_engine/tvgSwShape.cpp
@@ -37,13 +37,8 @@ struct Line
static float _lineLength(const Point& pt1, const Point& pt2)
{
- /* approximate sqrt(x*x + y*y) using alpha max plus beta min algorithm.
- With alpha = 1, beta = 3/8, giving results with the largest error less
- than 7% compared to the exact value. */
Point diff = {pt2.x - pt1.x, pt2.y - pt1.y};
- if (diff.x < 0) diff.x = -diff.x;
- if (diff.y < 0) diff.y = -diff.y;
- return (diff.x > diff.y) ? (diff.x + diff.y * 0.375f) : (diff.y + diff.x * 0.375f);
+ return sqrtf(diff.x * diff.x + diff.y * diff.y);
}