Skip to content

Add UnitMath.Clamp(value, min, max)#1213

Merged
angularsen merged 1 commit into
release/v4from
agl/backport-unitmath-clamp
Feb 23, 2023
Merged

Add UnitMath.Clamp(value, min, max)#1213
angularsen merged 1 commit into
release/v4from
agl/backport-unitmath-clamp

Conversation

@angularsen
Copy link
Copy Markdown
Owner

Backported from #1157 to v4.

This adds UnitMath.Clamp similar to Math.Clamp.

* Add UnitMath.Clamp(value, min, max)

* Change Clamp to convert min/max to the unit of value, following the principle of least surprise.

* Update UnitMath.cs

Co-authored-by: Marnix <marnix@iwell.nl>
Co-authored-by: Andreas Gullberg Larsen <andreas.larsen84@gmail.com>
@angularsen angularsen merged commit 19d7798 into release/v4 Feb 23, 2023
@angularsen angularsen deleted the agl/backport-unitmath-clamp branch February 23, 2023 21:21
@angularsen
Copy link
Copy Markdown
Owner Author

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