Skip to content
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

matrix.a 有时候返回 Promise,有时候返回number。 #1766

Open
alsotang opened this issue Oct 9, 2023 · 3 comments
Open

matrix.a 有时候返回 Promise,有时候返回number。 #1766

alsotang opened this issue Oct 9, 2023 · 3 comments
Assignees

Comments

@alsotang
Copy link
Contributor

alsotang commented Oct 9, 2023

【版本信息】

4.1.43

【平台信息】

Web 浏览器

【预期的表现】

matrix.a应该始终返回number。

【实际的情况】

matrix.a在启动的早期会返回 Promise,导致libpag被这个奇怪行为卡死,始终无法再渲染。

image image

【Demo及附件】

public get a(): number {

@alsotang
Copy link
Contributor Author

alsotang commented Oct 9, 2023

在每次 PAGView.init 之后,delay(1000) 可以规避这个bug,原理不明。并且此时所有 PAGView.init 都应该串行。

@alsotang
Copy link
Contributor Author

alsotang commented Oct 9, 2023

我用 https://www.npmjs.com/package/transformation-matrix 代替了 libpag 自带的 Matrix。
transform计算是与具体动画库无关的,所以可以找个纯js实现的transform计算库。

@alsotang
Copy link
Contributor Author

alsotang commented Oct 9, 2023

111.zip
demo如上。预期是4个pag一起运行,但是运行到第2个的时候,libpag就卡死了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants