feat: use transformFrom arg - #1033
Merged
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14ffc6a28c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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.
使用
transformFrom参数代替难以理解的 writeDefault 和 ignoreDefault 参数。具体来说,
transformFrom有两个值可以选:current和default。current对应writeDefault: false, ignoreDefault: true的情况,维持当前transform并只写入动画定义的字段。default对应writeDefault: true, ignoreDefault: false的情况,将舞台对象以baseTransform为基准,完整写入所有字段。writeDefault: false, ignoreDefault: false和writeDefault: true, ignoreDefault: true的情况一般来说不常用且别扭,因此不设这样的情况。但为了保证兼容性,这两个参数不会移除。如果没有传入transfromFrom参数,则这两个参数依然生效。如果以上三个参数都没有传入,那么实际上相当于
transformFrom=current的情况,这是新的默认行为和推荐做法。