Add access to bounds/content bounds from a scrollable viewport. (#2072)
* Add access to bounds/content bounds from a scrollable viewport in order to perform certain scrollable optimizations as a consumer. * Move bounds/content_bounds after relative_offset as per feedback.
This commit is contained in:
parent
6fc88c3c80
commit
e5afaa0892
1 changed files with 10 additions and 0 deletions
|
|
@ -1146,6 +1146,16 @@ impl Viewport {
|
|||
|
||||
RelativeOffset { x, y }
|
||||
}
|
||||
|
||||
/// Returns the bounds of the current [`Viewport`].
|
||||
pub fn bounds(&self) -> Rectangle {
|
||||
self.bounds
|
||||
}
|
||||
|
||||
/// Returns the content bounds of the current [`Viewport`].
|
||||
pub fn content_bounds(&self) -> Rectangle {
|
||||
self.content_bounds
|
||||
}
|
||||
}
|
||||
|
||||
impl State {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue