Skip to content

Conversation

dtzxporter
Copy link
Contributor

Added access to the bounds and content bounds of a scrollable's viewport. This is necessary to perform some scrollable optimizations such as virtual lists without creating your own widget, and piggybacking on the scrollable.

Added 2 methods for accessing the corresponding bounds from Viewport.

…er to perform certain scrollable optimizations as a consumer.
Comment on lines 1140 to 1148
/// 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
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move these after relative_offset.

@hecrj hecrj added this to the 0.12.0 milestone Sep 7, 2023
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks.

@hecrj hecrj enabled auto-merge (squash) September 7, 2023 01:38
@hecrj hecrj merged commit e5afaa0 into iced-rs:master Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants