From c9e4feb9dca6f6f2b01bc4cdf12166a31b722b21 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Mon, 18 Mar 2024 11:18:32 +0900 Subject: [PATCH] loader/svg: Remove duplicate if-check in pathAppendArcTo The if-check to skip-rule when drawing an arc path is already checked in line 476. In addition, since the float type equal check is performed in the range of 1/256, unintentional skiped may occur. Therefore, remove duplicate code. https://www.w3.org/TR/SVG2/paths.html#ArcOutOfRangeParameters test file: SVG_FILE_147893.svg related issue: https://github.com/thorvg/thorvg/issues/1255 --- src/loaders/svg/tvgSvgPath.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/loaders/svg/tvgSvgPath.cpp b/src/loaders/svg/tvgSvgPath.cpp index 67c87ba1..f9780749 100644 --- a/src/loaders/svg/tvgSvgPath.cpp +++ b/src/loaders/svg/tvgSvgPath.cpp @@ -122,9 +122,6 @@ void _pathAppendArcTo(Array* cmds, Array* pts, Point* cur, P sx = cur->x; sy = cur->y; - //If start and end points are identical, then no arc is drawn - if ((fabsf(x - sx) < (1.0f / 256.0f)) && (fabsf(y - sy) < (1.0f / 256.0f))) return; - //Correction of out-of-range radii, see F6.6.1 (step 2) rx = fabsf(rx); ry = fabsf(ry);