- disable unused builtin realm functions.
- disable global this
- disable regexp (potential)
- disable unicode case conversion (potential)
Some features are marked with (potential)
since we are not certain these are used practically.
until now, total binary size diff by expressions: +287kb
When the system fails to interpret the expression code,
it forcibly disables the feature per property.
This improvement enhances stability and performance
by avoiding reckless attempts to interpret JavaScript code.
When we confirm the full stability with expressions,
we can revert this code.
The current development of the expression engine is experimental.
It does not support multi-threading.
Therefore, when tvg::Initializer::init() is configured
with more than one thread, expressions will be automatically disabled.
issue: https://github.com/thorvg/thorvg/issues/1640
These internal methods have been introduced to search for content within
an object (parent) using a given parameter (name or index).
- LottieLayer* LottieGroup::asset(const char* name)
- LottieLayer* LottieComposition::asset(const char* name)
- LottieLayer* LottieComposition::layer(uint16_t id)
- LottieLayer* LottieComposition::layer(const char* name)
This converts the frame number to the corresponding time.
- float LottieComposition::timeAtFrame(float frameNo)
introduced the JerryScript engine to interpret Lottie
expressions, enhancing the capability to support runtime
programmable animation logic within Lottie expressions
spec. This feature, based on js scripting, represents
the most complicated addition to the Lottie spec so far.
ThorVG probably could includes an option to toggle
this feature at build time, allowing for customizable user
configurations according to specific requirements.
removed unused features for the optimal size:
- DEBUGGER
- MEM_STATS
- SNAPSHOT
- BUILTIN_JSON
- BUILTIN_PROXY
- BUILTIN_REFLECT
- BUILTIN_ATOMICS
- PROMISE_CALLBACK
- MODULE_SYSTEM
- SYSTEM_PORT
This is an experimental version.
Please manually enable the 'lottie-expressions' in meson.build
when you wish to use it.
See: https://jerryscript.net/
The display property was not copied along with other
node properties. This caused incorrect rendering
of an object with display=none if accessed through
a use tag.
This reverts commit 75e587a9a9.
If incorrect data for the points in a polygon is provided,
the element should still be rendered, but only up to the point
where the error occurs—using an even number of the points that
have been successfully loaded.
Selecting a tool without choosing the required tools
resulted in a usage error. Now, the activation
of the appropriate saver/loader for a given tool
is enforced.
Because memcpy() is not guaranteed to copy null at the end of the data array,
it increase the size by 1 and add null
This prevents invalid access of string functions in parser.
A single animation might have a desinated markers with naming: 0 ~ 0.5 (sector A), 0.5 ~ 1.0 (sector B). Selecting one of them using a marker name(sector A) and could play only that part with animation controllers.
usage:
- `animation->segment("sectionA") // Named segment(Marker)`
- `auto cnt = animation->markerCnt()`
- `auto name = animation->markers(index)`
- `animation->segment(0, 0.5) // Segment`
- `animation->segment(&begin, &end)`
Co-authored-by: Jinny You <jinny@lottiefiles.com>
If the command after `m` is not recognized, it must be recognized as `l` or `L`.
However, if it is not recognized after ending with `z`, all commands after it are ignored.
```
<svg width="100" version="1.0" xmlns="http://www.w3.org/2000/svg" height="100" xmlns:xlink="http://www.w3.org/1999/xlink">
<path style="stroke:#F00" d="m 20,20 0,50 50 0 -50 -50 z 70,70 0,50 50 0 -50 -50 z "/>
</svg>
```
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