svg_loader SvgPath: Remove unnecessary optimization code
authorJunsuChoi <jsuya.choi@samsung.com>
Fri, 5 Mar 2021 03:40:18 +0000 (12:40 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Mon, 8 Mar 2021 06:53:30 +0000 (15:53 +0900)
This condition(optimization) is not a step suggested by arc implementation.
https://www.w3.org/TR/SVG11/implnote.html#ArcCorrectionOutOfRangeRadii (Step2)
This code is useful if the arc is too small to represent.
However, scaling often occurs in vectors, which can create unnecessary problems.

example path
<path d="M32.41,20.49a.41.41,0,1,1-.41-.42A.41.41,0,0,1,32.41,20.49Z" transform="translate(0)" fill="#020202"/>

src/loaders/svg/tvgSvgPath.cpp

index 880cd7b..c0bc450 100644 (file)
@@ -90,13 +90,6 @@ void _pathAppendArcTo(Array<PathCommand>* cmds, Array<Point>* pts, Point* cur, P
     //Correction of out-of-range radii, see F6.6.1 (step 2)
     rx = fabsf(rx);
     ry = fabsf(ry);
-    if ((rx < 0.5f) || (ry < 0.5f)) {
-        Point p = {x, y};
-        cmds->push(PathCommand::LineTo);
-        pts->push(p);
-        *cur = p;
-        return;
-    }
 
     angle = angle * M_PI / 180.0f;
     cosPhi = cosf(angle);