Support Bezier curve - #2781
Open
MarkYav wants to merge 4 commits into
Open
Conversation
…zier paths. - Refactors RemoteBezierValue mapping to store fully-typed RemoteFloat matrix values, ensuring AST constraints are tracked per parameter inside drawScope.remotePath. - Translates dynamic segments recursively with chainBezierAnimation, enabling sequence looping across multi-keyframe structures. - Parses and renders multiple path splines synchronously within gatherShapes. - Fixes an IndexOutOfBoundsException edge case when evaluating rendering geometries for open paths.
- Disassembled monolithic Animation.kt core into granular, single-responsibility domain scopes (AnimationUtils.kt, PositionAnimation.kt, VectorAnimation.kt, BezierAnimation.kt). - Centralized repetitive keyframe tangent mathematics into a universal evaluateKeyframeProgress helper strictly tracking AST interpolation durations. - Encapsulated loop allocations into declarative sequence builders, shrinking all evaluation methods below 25 lines to prevent mental parsing overhead (SLAP). - Abstracted canvas spline drawing iteration logic securely into explicit RemotePathScope.drawSplinePaths extensions.
yschimke
reviewed
Aug 11, 2026
yschimke
left a comment
Collaborator
There was a problem hiding this comment.
I'm unclear if it's passing tests because it produces identical output, or because we don't have good existing coverage of these tests.
Can you add a screenshot test covering this.
Also, are there any other unit tests we should consider for various cases.
| val p2 = listOf(p4[0] + inTangent[0], p4[1] + inTangent[1]) | ||
|
|
||
| rcPath.cubicTo(p1[0], p1[1], p2[0], p2[1], p4[0], p4[1]) | ||
| private fun path(lottiePath: Path, animationSettings: LottieSettings): List<RemoteLottiePath> { |
Collaborator
There was a problem hiding this comment.
If we are splitting to a List of paths, what happens with any effects like caps on the start or the ends? do we treat these differently after this?
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHAT
Adds full Remote Compose Bezier spline animation support by replacing static path translations with dynamic expression tree
RemoteFloatevaluations. Furthermore, completely restructures the underlying Keyframe/Bezier rendering classes into single-responsibility, SLAP-enforced modular files.WHY
Previously, bezier path lookups used static cubic easing arrays parsed from Lottie keyframes. To correctly enable state-driven multi-node spline paths (i.e. morphing Lottie vector geometries dynamically through variables on wear targets), Remote Compose paths required fully-typed
RemoteFloatchained logic translating easing tangents seamlessly. The structural refactor addresses code density rules, moving monolithic handlers into dry helpers (less than 25 lines/method) which keeps the interpolation math legible and sustainable long-term.HOW
RemoteLottiePathgeneration strictly ontoRemoteFloatevaluations relying heavily on nativecubicEasingoperations instead of simple interpolated float arrays.chainBezierAnimation, enabling deep array segments to execute Remote Compose property conditional cascades cleanly over timeline boundaries.gatherShapesparsing vectors rather than singular objects, stopping runtime open path geometry boundary failures (IndexOutOfBoundsException) inherently.Animation.ktcore with 4 explicitly-scoped responsibilities (AnimationUtils.kt,PositionAnimation.kt,VectorAnimation.kt,BezierAnimation.kt) all abiding strictly by SLAP paradigms (< 25-line ceilings by isolating low-level initialization routines in cleanly named builder methods).RemotePathScope.drawSplinePaths.Checklist 📋