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

Fix wrong range constrained bindable value transferal in CopyTo() #5542

Merged

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Nov 24, 2022

Regressed in 9faae09.

When copying over values of a range-constrained bindable, the range bounds need to be transferred first, because otherwise assignment to .Value of a range-constrained bindable will automatically clamp the value to [MinValue, MaxValue], leading to a scenario where a new value being transferred across would get clamped to stale bounds.

This affected both .CopyTo() and .BindTo(), as the latter calls the former.

Regressed in 9faae09.

When copying over values of a range-constrained bindable, the range
bounds need to be transferred first, because assignment to `.Value` of a
range-constrained bindable will automatically clamp the value to
[`MinValue`, `MaxValue`], leading to a scenario where a new value being
transferred across would get clamped to stale bounds.

This affected both `.CopyTo()` and `.BindTo()`, as the latter calls the
former.
@bdach bdach requested a review from peppy November 24, 2022 20:41
@bdach bdach mentioned this pull request Nov 24, 2022
1 task
@peppy peppy merged commit 36b9adb into ppy:master Nov 25, 2022
@bdach bdach deleted the fix-wrong-constrained-bindable-value-transferal branch November 25, 2022 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants