diff options
author | Blaž Hrastnik | 2021-12-10 10:23:34 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-12-10 10:23:58 +0000 |
commit | 3307f44ce20a71273614f9b30dafb08822e557a1 (patch) | |
tree | e1822706818048dcd2ccd41402e182e7f8e2a96c /helix-term/src/compositor.rs | |
parent | b66d3d3d9dccbb9c28d8611c4a0fc5d74ccb27d6 (diff) |
ui: popup: Don't allow scrolling past the end of content
Diffstat (limited to 'helix-term/src/compositor.rs')
-rw-r--r-- | helix-term/src/compositor.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs index 37e67973..30554ebb 100644 --- a/helix-term/src/compositor.rs +++ b/helix-term/src/compositor.rs @@ -55,9 +55,10 @@ pub trait Component: Any + AnyComponent { /// May be used by the parent component to compute the child area. /// viewport is the maximum allowed area, and the child should stay within those bounds. + /// + /// The returned size might be larger than the viewport if the child is too big to fit. + /// In this case the parent can use the values to calculate scroll. fn required_size(&mut self, _viewport: (u16, u16)) -> Option<(u16, u16)> { - // TODO: for scrolling, the scroll wrapper should place a size + offset on the Context - // that way render can use it None } |