Skip to content

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

Open
hoodmane wants to merge 2 commits intoCurriculumAssociates:mainfrom
hoodmane:pixi-less-slow
Open

Rename _render to _updateLatex in Pixi widget so it isn't called every frame#50
hoodmane wants to merge 2 commits intoCurriculumAssociates:mainfrom
hoodmane:pixi-less-slow

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
Contributor

@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.

2 participants

Comments