Skip to content

Commit

Permalink
Add some more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmerlin committed Jul 17, 2024
1 parent 3be1cba commit 1e4e873
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/egui/src/frame_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ pub struct PerLayerState {

#[derive(Clone, Debug)]
pub struct ScrollTarget {
// The range that the scroll area should scroll to.
pub range: Rangef,
/// How should we align the rect within the visible area?
/// If `align` is [`Align::TOP`] it means "put the top of the rect at the top of the scroll area", etc.
/// If `align` is `None`, it'll scroll enough to bring the UI into view.
pub align: Option<Align>,
/// How should the scroll be animated?
pub animation: style::ScrollAnimation,
}

Expand Down
1 change: 1 addition & 0 deletions crates/egui/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ impl Response {
self.scroll_to_me_animation(align, self.ctx.style().scroll_animation);
}

/// Like [`Self::scroll_to_me`], but allows you to specify the [`crate::style::ScrollAnimation`].
pub fn scroll_to_me_animation(
&self,
align: Option<Align>,
Expand Down

0 comments on commit 1e4e873

Please sign in to comment.