LiveSplit / livesplit-core

livesplit-core is a library that provides a lot of functionality for creating a speedrun timer.
https://livesplit.org/
Apache License 2.0
209 stars 57 forks source link

Skip rendering to a canvas with zero dimensions #805

Closed CryZe closed 4 months ago

CryZe commented 4 months ago

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:

https://github.com/LiveSplit/LiveSplitOne/issues/881

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