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

Rename _render to _updateLatex in Pixi widget so it isn't called every frame #50

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hoodmane
Copy link

@hoodmane hoodmane commented Mar 9, 2022

Trying to use this in a pixi.js animation I found it was extremely slow. Problem seems to be that PixiJS._render is called by pixi.js every frame. But we actually only want to call it when the math changes, which is relatively unusual. This patch fixes the performance trouble.

Copy link
Collaborator

@mattbargar-cainc mattbargar-cainc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hoodmane - this looks great and totally makes sense; would you mind just making a comment in this file to say that this new method name corresponds to the _render() method in the createjs version?

@hoodmane
Copy link
Author

hoodmane commented Mar 9, 2022

What about renaming that one too? I think _updateLatex or something in that vein is a more accurate name anyways since this function doesn't need to be called to render the latex, only whenever the latex changes.

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

Successfully merging this pull request may close these issues.

None yet

2 participants