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

Skip rendering to a canvas with zero dimensions #805

Merged
merged 1 commit into from
May 18, 2024

Conversation

CryZe
Copy link
Collaborator

@CryZe CryZe commented May 18, 2024

If the width or height is 0, the element likely isn't mounted into the DOM. This usually isn't a problem, but if we end up resizing the layout, we would resize it based on a size of 0, which would break the entire layout. This happened here:

LiveSplit/LiveSplitOne#881

Rendering the layout with a size of 0 is also a waste of time, so this ends up benefiting us in multiple ways.

If the width or height is 0, the element likely isn't mounted into the
DOM. This usually isn't a problem, but if we end up resizing the layout,
we would resize it based on a size of 0, which would break the entire
layout. This happened here:

LiveSplit/LiveSplitOne#881

Rendering the layout with a size of 0 is also a waste of time, so this
ends up benefiting us in multiple ways.
@CryZe CryZe added bug There is a bug. enhancement An improvement for livesplit-core. rendering The issue or pull request is affecting the rendering. priority: high This is a high priority issue. performance Affects the performance of the code. labels May 18, 2024
@CryZe CryZe added this to the v0.14 milestone May 18, 2024
@CryZe CryZe changed the title Skip renderer to an a canvas with zero dimensions Skip rendering to an a canvas with zero dimensions May 18, 2024
@CryZe CryZe changed the title Skip rendering to an a canvas with zero dimensions Skip rendering to a canvas with zero dimensions May 18, 2024
@CryZe CryZe merged commit 99fbe17 into LiveSplit:master May 18, 2024
69 of 70 checks passed
@CryZe CryZe deleted the web-renderer-zero-dim branch May 18, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug There is a bug. enhancement An improvement for livesplit-core. performance Affects the performance of the code. priority: high This is a high priority issue. rendering The issue or pull request is affecting the rendering.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant