Fix possible std::clamp contract violation.
This commit is contained in:
parent
65310f32dc
commit
762a611f20
1 changed files with 1 additions and 1 deletions
|
|
@ -226,7 +226,7 @@ public:
|
||||||
|
|
||||||
// Updates the area that is visible inside the scroll container.
|
// Updates the area that is visible inside the scroll container.
|
||||||
void setVisibleTopBottom(int visibleTop, int visibleBottom) {
|
void setVisibleTopBottom(int visibleTop, int visibleBottom) {
|
||||||
auto max = height();
|
const auto max = std::max(height(), 0);
|
||||||
visibleTopBottomUpdated(
|
visibleTopBottomUpdated(
|
||||||
std::clamp(visibleTop, 0, max),
|
std::clamp(visibleTop, 0, max),
|
||||||
std::clamp(visibleBottom, 0, max));
|
std::clamp(visibleBottom, 0, max));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue