mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-17 17:42:51 +00:00
Fix ButtonSet widget with icons resizing when UIScale is changed
This commit is contained in:
parent
0c3d78b4ce
commit
081f1e535b
@ -1,5 +1,5 @@
|
|||||||
// Aseprite UI Library
|
// Aseprite UI Library
|
||||||
// Copyright (C) 2019-2022 Igara Studio S.A.
|
// Copyright (C) 2019-2023 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
@ -685,8 +685,10 @@ gfx::Size Theme::calcMinSize(const Widget* widget,
|
|||||||
|
|
||||||
gfx::Size sz = widget->minSize();
|
gfx::Size sz = widget->minSize();
|
||||||
|
|
||||||
if (sz.w == 0) sz.w = style->minSize().w;
|
if (sz.w == 0 || style->minSize().w > 0)
|
||||||
if (sz.h == 0) sz.h = style->minSize().h;
|
sz.w = style->minSize().w;
|
||||||
|
if (sz.h == 0 || style->minSize().h > 0)
|
||||||
|
sz.h = style->minSize().h;
|
||||||
|
|
||||||
return sz;
|
return sz;
|
||||||
}
|
}
|
||||||
@ -699,8 +701,11 @@ gfx::Size Theme::calcMaxSize(const Widget* widget,
|
|||||||
|
|
||||||
gfx::Size sz = widget->maxSize();
|
gfx::Size sz = widget->maxSize();
|
||||||
|
|
||||||
if (sz.w == std::numeric_limits<int>::max()) sz.w = style->maxSize().w;
|
int maxInt = std::numeric_limits<int>::max();
|
||||||
if (sz.h == std::numeric_limits<int>::max()) sz.h = style->maxSize().h;
|
if (sz.w == maxInt || style->maxSize().w < maxInt)
|
||||||
|
sz.w = style->maxSize().w;
|
||||||
|
if (sz.h == maxInt || style->maxSize().h < maxInt)
|
||||||
|
sz.h = style->maxSize().h;
|
||||||
|
|
||||||
return sz;
|
return sz;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user