Currently, tvg ignores the frame value if the difference
is less than 0.001. In most cases, updating the frames
when the change is less than 1ms is just an unnecessary
burden on the system.
Instead, this ensures that the perfect last frame is reached.
issue: https://github.com/thorvg/thorvg/issues/2147
This correction addresses the drawing order of
objects when a group contains a TrimPath and
is merging shapes.
Additionally, the TrimPath method is can applied
to the engine to control the drawing behavior by
7f3dc541d6b7abcdc03facd884489f37c327fd98
issue: https://github.com/thorvg/thorvg/issues/2047
this optimization nicely merges shapes
when a child group has a only (transformed) pathes.
this also fixes the following compatibility issue nicely.
issue: https://github.com/thorvg/thorvg/issues/2061
When finding the 'nodeFrom' referenced by `<use>`,
if it is the parent, it is not referenced.
https://www.w3.org/TR/SVG2/struct.html#UseElement
Specification:
If the referenced element is a (shadow-including) ancestor
of the ‘use’ element, then this is an invalid circular reference
and the ‘use’ element is in error.
related issue: https://github.com/thorvg/thorvg/issues/2078
SVG_FILE_65171.svg
SVG_FILE_65172.svg
removed unused static condition.
static was prepared for optimization,
but not used at all.
we will revisit this later when time permits.
binary size: -6kb
When lottie is broken and provides invalid gradient, the program crashes in segmentation fault.
At that time, in the `populate` function, `ColorStop& color` doesn't have `input` but tries to use it.
Added checking nullptr logic. The function `populate` will not proceed and return 0 in that case.
related issue: #2072
Slot overriding tries to set property via the `LottieObject`. It potentially causes unexpected changes.
Revised the `override` function. The purpose of this patch is to aim atomic property to be overriden.
Implemented the ability to revert Lottie slots by calling override with nullptr.
This functionality allows for the complete reversal of applied slots.
usage:
- `animation->override(nullptr)`
Co-Authored-By: Hermet Park <hermet@lottiefiles.com>
When image data fails to load or image parsing fails,
the id is leaked without being assigned to the name.
To prevent that, free id value when obj is nullptr.
related issue: https://github.com/thorvg/thorvg/issues/2072
BrokenLottie.7z/test3_IDX_130_RAND_18289244608080059871.json
BrokenLottie.7z/test3_IDX_131_RAND_7772102071213376276.json
BrokenLottie.7z/test3_IDX_132_RAND_3072617087893397532.json
BrokenLottie.7z/test3_IDX_134_RAND_17738488813555566674.json
BrokenLottie.7z/test3_IDX_137_RAND_13903188963759129023.json
BrokenLottie.7z/test3_IDX_138_RAND_1645404078965858130.json
When json file is invalid in the parser,
the LottieComposition object is not released and the parse() returns false.
To prevent memory leaks, free the memory before returning false.
related issue : https://github.com/thorvg/thorvg/issues/2070
Enhances the portability of the TTF loader on UWP platforms
by implementing an alternative file loading mechanism.
This is designed to support environments where the file mapping
feature is not available, ensuring wider compatibility and reliability
in file handling.
Issue: https://github.com/thorvg/thorvg/issues/1912
error: storing the address of local variable 'context' in '*this.LottieParser::context' [-Werror=dangling-pointer=]
1255 | this->context = &context;
issue: https://github.com/thorvg/thorvg/issues/2051
The lottie format defines the starting point for
drawing rectangles and ellipses differently than
the API available in the TVG. In the case of using
dashes or trim paths, this leads to discrepancies.
Therefore, when using the lottie builder, internal
functions for appending rectangles and circles are
utilized.
@issue: https://github.com/thorvg/thorvg/issues/1997
This class extends the Animation and serves advanced Lottie features.
It's designed to separately have Lottie Animation's unique specs.
For now, this will have Slot overriding feature,
you can include <thorvg_lottie.h> for its extensive features.
@APIs:
- Result LottieAnimation::override(const char* slotJson) noexcept;
- static std::unique_ptr<LottieAnimation> LottieAnimation::gen() noexcept;
@Issue: https://github.com/thorvg/thorvg/issues/1808
Internal model and parser modifications have been made
to parse "sid" and retrieve their data into the LottieComposition.
This will enable dynamic changes to the following Lottie objects:
The slot feature will encompass these properties:
- LottieSolidStroke
- LottieSolidFill
- LottieGradientStroke
- LottieGradientFill
- LottieTextDoc"
Issue: https://github.com/thorvg/thorvg/issues/1808
Co-authored-by: Hermet Park <hermet@lottiefiles.com>
To ensure consistent properties, `LottieSolid` has been defined.
Both `LottieSolidStroke` and `LottieSolidFill` can be typecasted to the `LottieSolid`.