The API allows now values <= 0 for dashes and gaps. Negative values
are treated as zero. The exception is when all provided values
are <= 0, in which case the dash is ignored.
This fixes the issue when dash = 0 was provided for strokes with round
or butt caps - the dot was not drawn, even though it should have been.
docs: the strokeDash API behavior's clarification for odd numbers
of values in dashPattern and refinement of the accepted values.
This adds support for a static scene mode,
allowing a scene to be treated as a static image.
In this mode, partial rendering for the inner
drawable components is skipped. This is especially
useful for scenes designed to be fully updated as a whole,
such as those used in fully dynamic Lottie contents.
issue: https://github.com/thorvg/thorvg/issues/1747
- 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).
../src/loaders/jpg/tvgJpgd.cpp:670:10: note: ‘padding_flag’ was declared here
670 | bool padding_flag;
| ^~~~~~~~~~~~
../src/loaders/jpg/tvgJpgd.cpp:674:9: warning: ‘padding_flag’ may be used uninitialized [-Wmaybe-uninitialized]
674 | if (padding_flag) return 0xFF;
| ^~
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.
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 first margin value shifts the starting point where the text
begins along the path. Now cases where firstMargin < 0 are handled,
for both closed and open paths.
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>
The incorrect line join used for OffsetPath was caused
by changes to the StrokeJoin enum values in commit
34d731fa94. During those
changes, the line join value for OffsetPath was mistakenly
not updated.
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
The following is a redesign that extends the class internally.
The main goal is to preserve the characteristics of the pImpl idiom
for data encapsulation, while simultaneously reducing the memory
allocation overhead typically associated with pImpl.
The stragegy is here:
Rather than alloc the impl memory inside of the thorvg engine,
impl extends the API classes in order to consolidate the memory.
size has been decreased by -4kb with optimization=s
issue: https://github.com/thorvg/thorvg/issues/3214
* lottie: fixes in follow path
Each time the 'updateText' was called, the mask
path (if the follow path existed) was appended
to the previous one, causing it to grow infinitely.
A 'clear' call on the existing path was missing.
The positions on the follow path for distances larger
than 2 x mask path length were not correctly calculated.
* lottie: fix crash on follow path
It could happen that the searched text position
(distance from the start pointt) on the follow path
was exactly equal to the path length. In such a case,
the cmds pointer pointed to the last element, and in
the next iteration, this caused a crash.
effect(name) / effect(index)
effects finds the effect by its name in the Effect Controls panel.
The name can be the default name or a user-defined name.
If multiple effects have the same name,
the effect closest to the top of the Effect Controls panel is used.
example:
- effect("Fast Blur")("Blurriness")
issue: https://github.com/thorvg/thorvg/issues/3115
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>
ThorVG cap/join enums and lottie specs were not aligned.
Problem was observed for StrokeCap::Square and StrokeJoin::Bevel.
Note: this change breaks backward comatibility.
usage) temporalWiggle(freq, amp, octaves=1, amp_mult=.5, t=time)
Samples the property at a wiggled time. The freq value is the frequency
in wiggles per second, amp is the amplitude in units of the property
to which it is applied, octaves is the number of octaves of noise
to add together, amp_mult is the amount that amp is multiplied by
for each octave, and t is the base start time. For this function
to be meaningful, the property it samples must be animated,
because the function alters only the time of sampling, not the value.
Note: need to verify this with a practical samples.
issue: https://github.com/thorvg/thorvg/issues/1640