-
Notifications
You must be signed in to change notification settings - Fork 2k
补充 jsb中 spine.updateAnimation() 遗漏的 markForUpdateRenderData() #18548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3.8.7
Are you sure you want to change the base?
Conversation
ts 版本的 updateAnimation() 中有 调用 markForUpdateRenderData() 但是 jsb版本中缺失了这条语句
Code Size Check Report
Interface Check ReportThis pull request does not change any public interfaces ! |
@@ -426,6 +426,8 @@ const cacheManager = require('./jsb-cache-manager'); | |||
const node = this.node; | |||
if (!node) return; | |||
|
|||
this.markForUpdateRenderData(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个如果没加上会有什么问题吗? 因为 middleWare.render 每帧都执行;理论上可以正常渲染
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个如果没加上会有什么问题吗? 因为 middleWare.render 每帧都执行;理论上可以正常渲染
如果你觉得 这个是多余的 , 那建议把 ts 版本的 updateAnimation() 中 的这行代码也移除.
我很看重代码编写思路的一致性. 否则别人在维护你的代码时 会困惑. 为啥做类似的事 , 这里是思路 A, 那里却是思路 B.
我提交的这个 PR #18549 其实也类似.
- 统一删除 markForUpdateRenderData() (不管它有没有用, 都不应该在 setAnimation/addAnimation 时执行.
- 统一了判断 animation 是否有效的逻辑, 先判断 , 无效直接返回.
- 统一通过 this._state 来调用原生方法.
要说这几个不改有什么严重问题吗? 其实也没有. 但是在看代码时 就很困惑.
可能你们很忙, 没时间在乎这些细枝末节. 所以我提 PR, 帮你们做. 希望你们能采纳.
又测试了一下,updateAnimation 中的 this.markForUpdateRenderData 还必须要加。 |
这个有具体的demo吗 |
在实际项目里. 比较复杂. |
ts 版本的 updateAnimation() 中有 调用 markForUpdateRenderData()
但是 jsb版本中缺失了这条语句
Re: #
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: