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

Add resize hint to the Web Renderer #794

Merged
merged 1 commit into from
Apr 27, 2024
Merged

Conversation

CryZe
Copy link
Collaborator

@CryZe CryZe commented Apr 27, 2024

The web renderer now returns the new size whenever the element is supposed to be resized. This is important so adding or removing a component to the layout or loading a new layout will adjust the size of the element accordingly. This is the same way the other renderers handle it, so we should do the same for the web renderer.

Additionally this fixes a bug in the way the strings got passed from JavaScript to Rust, where we introduced a difference between the length of a string and the capacity of its allocation, but didn't properly differentiate between them everywhere.

The web renderer now returns the new size whenever the element is
supposed to be resized. This is important so adding or removing a
component to the layout or loading a new layout will adjust the size of
the element accordingly. This is the same way the other renderers handle
it, so we should do the same for the web renderer.

Additionally this fixes a bug in the way the strings got passed from
JavaScript to Rust, where we introduced a difference between the length
of a string and the capacity of its allocation, but didn't properly
differentiate between them everywhere.
@CryZe CryZe added bug There is a bug. enhancement An improvement for livesplit-core. c api The issue or pull request is about the C API. rendering The issue or pull request is affecting the rendering. feature A new user visible feature for livesplit-core. labels Apr 27, 2024
@CryZe CryZe added this to the v0.14 milestone Apr 27, 2024
@CryZe CryZe merged commit cb43b07 into LiveSplit:master Apr 27, 2024
70 checks passed
@CryZe CryZe deleted the web-resize-hint branch April 27, 2024 15:58
CryZe added a commit that referenced this pull request Apr 27, 2024
The web renderer now returns the new size whenever the element is
supposed to be resized. This is important so adding or removing a
component to the layout or loading a new layout will adjust the size of
the element accordingly. This is the same way the other renderers handle
it, so we should do the same for the web renderer.

Additionally this fixes a bug in the way the strings got passed from
JavaScript to Rust, where we introduced a difference between the length
of a string and the capacity of its allocation, but didn't properly
differentiate between them everywhere.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug There is a bug. c api The issue or pull request is about the C API. enhancement An improvement for livesplit-core. feature A new user visible feature for livesplit-core. rendering The issue or pull request is affecting the rendering.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant