Previously, only single-level <use> references were supported.
If a <use> node pointed to another element that itself contained
a <use> node, the reference wasn’t resolved.
This has been fixed by replacing the array of postponed elements
with a list. The list is traversed, and nodes aren’t cloned while
they or any of their children remain unresolved. In such cases,
the target element also gets added to the list, enabling recursive
resolution of nested href references.
issue: https://github.com/thorvg/thorvg/issues/3615
- shadow rendering was skipped when the blur value was 0.
it now correctly renders shadows without blur.
- this also fixes the distance offset scalability.
issue: https://github.com/thorvg/thorvg/issues/3602
- Ensured proper closure of star and polygon shapes.
The start and end points now match - in cases with
degenerate bezier curves, the second-to-last point
is also aligned.
Proper shape closure is necessary for modifiers like
offset (future pucker bloat). If the start and end
points aren’t equal (within the comparison function’s
precision), the shape will be closed with a straight
line - and during offsetting, that line will become
visible, even though it’s not intended.
- Use of the internal _zero() function for point equality check
in modifiers algs led to incorrect results when p2.x or p2.y
was zero (division by zero).
The intent was to treat nearly identical points as equal, but
this approach was flawed - at the modifier stage, it’s no longer
possible to tell if small gaps are intentional or just due to
limited numerical precision (as seen for example in the difference
between the start and end points of star/polygon shapes).
This approach should be introduced in d8ebd8b4f5.
Using FLOAT_EPSILON is not sufficient due to numerical precision,
since it's later inverted, and its very small value leads to
significant errors during inversion.
If the radial gradient's focal point lies outside
the end circle, it's projected onto the edge.
A slight inward offset is applied to avoid numerical
issues.
Note:
Focal point support in the sw and wg engines is
consistent with the SVG 1.1 standard, whereas the gl
engine aligns with the SVG 2.0 standard.
One point was skipped during the creation of the offset
corner. The error was not visible because the point lies
on the line, but it will become apparent if further
modifiers are applied to the object (not supported now).
previous logic doesn't work if the clipping shape
has any inner corners. replace the logic
with a intermediate composition approach for
stability.
- performance can be drop at texture clipping by ~11%
- size is reduced by -0.5kb
issue: https://github.com/thorvg/thorvg/issues/3520
A precomposition layer is clipped to its viewport.
If the same layer also had a mask that was optimized
using clipping, this clip was unintentionally overridden
by the viewport clipping. This conflict is now fixed.
In some clipping cases, the memory allocated for storing spans
was too small. As a result, the entire clipped area might not
have been rendered.
This has been resolved by adding an experimental factor to increase
the size of allocated memory.
@issue: https://github.com/thorvg/thorvg/issues/3461
If stop is declared immediately after Gradient is closed, the stop is registered in latestGradient.
Change latestGradient to a Stack and add a stop only to the last added gradient.
When that gradient is closed, no more stops should be registered for that gradient.
And gradients do not allow nested declarations, so only the earliest declared Gradient is valid.
The time remapping logic had an issue where animations with zero value "tm"(Time Remap) were not being processed correctly.
This was happening because the previous implementation only applied time remapping when the value was non-zero. (A zero-value Time Remap should be applied, but is ignored)
The fix changes the default time remap value to `-1.0` (since frame values cannot be negative) and applies time remapping when the value is 0.0 or greater. This ensures that zero value time remapping is properly processed.
The "s" key does not have to appear at the beginning
of the position block. Previously, such cases would
result in a parsing error — now they are handled correctly.
- prioritize valid (positive) cases first
- continue parsing even when encountering parsing errors
Co-Authored-By: Mira Grudzinska <mira@lottiefiles.com>
Clipping for the <use> node when a <symbol> was used,
was being overridden when 'overflowVisible' was 'true'
(the default value), which caused the 'clip-path' applied
to the <use> node to have no visible effect.
The clipping for the <use> node (without <symbol> node) was
transformed in an incorrect order, resulting in a visually
incorrect results.
@Issue: https://github.com/thorvg/thorvg/issues/3392
ThorVG did not consider updates to the clipping path
when a paint object was modified after being added to the scene.
This fix ensures that any updates to clipping are correctly
reflected during rendering.
issue: https://github.com/thorvg/thorvg/issues/3403
Duplicated text document properties (fill color, stroke color, and stroke width) to the text range.
If these properties are not defined in the range selector, ThorVG incorrectly overrides them with default values.
The correct behavior is to preserve the original values. The added flags address this issue.
Co-Authored-By: Hermet Park<hermet@lottiefiles.com>