feat: enhance BarBounce and BarUtils for better handling of animated …#298
feat: enhance BarBounce and BarUtils for better handling of animated …#298
Conversation
…butes for better animation handling
There was a problem hiding this comment.
Pull request overview
Updates bar-related custom animations in vstory-animate to better handle normalized bar rect attributes during animation, and adds unit tests to prevent regressions.
Changes:
- Adjusts
createCollapsedBarRectto produce clearer collapsed start rects (explicit width/height handling). - Fixes
BarBounceorientation handling after rect normalization and computes animatedwidth/heightduring updates. - Adds unit tests covering null-from rects, vertical collapse behavior, and horizontal-mode normalization.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/vstory-animate/src/customAnimates/bar-utils.ts | Refines collapsed bar rect generation for vertical/horizontal cases. |
| packages/vstory-animate/src/customAnimates/bar-bounce.ts | Uses a stored vertical/horizontal mode, updates animated width/height, and updates target tags. |
| packages/vstory-animate/tests/unit/index.test.ts | Adds coverage for BarBounce orientation/collapse behavior and update side effects. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Object.assign(this.target.attribute, out); | ||
| this.target.addUpdatePositionTag(); | ||
| this.target.addUpdateShapeAndBoundsTag(); |
There was a problem hiding this comment.
onUpdate mutates this.target.attribute directly and then calls addUpdatePositionTag / addUpdateShapeAndBoundsTag. This bypasses the public setAttributes API used elsewhere (including onBind) and introduces a hard dependency on internal target methods that may not exist for all render targets. Prefer this.target.setAttributes(out) (or rely on the base ACustomAnimate update mechanism) so dirty flags/tags are handled consistently.
| Object.assign(this.target.attribute, out); | |
| this.target.addUpdatePositionTag(); | |
| this.target.addUpdateShapeAndBoundsTag(); | |
| this.target.setAttributes(out); |
…properties
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
🐞 Bugserver case id
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
copilot:summary
🔍 Walkthrough
copilot:walkthrough