Previously, the rounding modifier was always applied
first, which led to incorrect results when a different
modifier order was expected.
This update removes that limitation and enables modifiers
to be applied in any order.
Additionally, the code now prevents an infinite loop that
occurred when the rounded corners modifier was applied
multiple times (a cycle where next was set to this).
Added support for LineTo path commands in the rounding
corners modifier algorithm. This is necessary to allow
other modifiers to be applied before rounding, as previously
only CubicTo segments from the original lottie data were
handled.
According to tests in AE, the offset direction should
not depend on the direction of the shape. A positive
offset value expands the shape, while a negative value
contracts it. Fixed.
For long Bezier curves compared to the offset value,
the offsetting algorithm caused deformation. The problem
became evident after adding mask extension, as the simple
shapes defined there are based on Bezier curves rather
than as shapes like a circle/rect/etc, which is the case
for the offset. Now fixed.
Due to the lack of an analytical solution for Bezier
curves offsetting, a simple and computationally cheap
approximation has been implemented. The algorithm shifts
the segments connecting control points and determines
new points based on their intersections.
@issue: https://github.com/thorvg/thorvg/issues/2230