mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 04:41:11 +00:00
Bug 1929262 - Use std::clamp instead of min/max chain in widget/nsBaseWidget.h r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D227974
This commit is contained in:
parent
99b89d001a
commit
c72bd3a22d
@ -570,9 +570,8 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference {
|
||||
*/
|
||||
void ConstrainSize(int32_t* aWidth, int32_t* aHeight) override {
|
||||
SizeConstraints c = GetSizeConstraints();
|
||||
*aWidth = std::max(c.mMinSize.width, std::min(c.mMaxSize.width, *aWidth));
|
||||
*aHeight =
|
||||
std::max(c.mMinSize.height, std::min(c.mMaxSize.height, *aHeight));
|
||||
*aWidth = std::clamp(*aWidth, c.mMinSize.width, c.mMaxSize.width);
|
||||
*aHeight = std::clamp(*aHeight, c.mMinSize.height, c.mMaxSize.height);
|
||||
}
|
||||
|
||||
CompositorBridgeChild* GetRemoteRenderer() override;
|
||||
|
Loading…
Reference in New Issue
Block a user