mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-27 11:16:03 +00:00
Fix bad scrolling detection
This commit is contained in:
parent
e8960fe89d
commit
2e308d8d26
@ -69,12 +69,15 @@ where
|
|||||||
size
|
size
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Re-define `available` using the new, actual size.
|
||||||
|
let available = size.saturating_sub(scrollbar_size);
|
||||||
|
|
||||||
// On non-scrolling axis, give inner_size the available space instead.
|
// On non-scrolling axis, give inner_size the available space instead.
|
||||||
let inner_size = get_scroller(model)
|
let inner_size = get_scroller(model)
|
||||||
.is_enabled()
|
.is_enabled()
|
||||||
.select_or(inner_size, size.saturating_sub(scrollbar_size));
|
.select_or(inner_size, available);
|
||||||
|
|
||||||
let new_scrolling = inner_size.zip_map(size, |i, s| i > s);
|
let new_scrolling = inner_size.zip_map(available, |i, s| i > s);
|
||||||
|
|
||||||
(inner_size, size, new_scrolling)
|
(inner_size, size, new_scrolling)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user