Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions widget/src/text_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,16 @@ where
Some(self.line(0)?.ending)
}

/// Returns the current boundaries of the [`Content`].
pub fn bounds(&self) -> Size {
self.0.borrow().editor.bounds()
}

/// Returns the minimum boundaries to fit the current text in the [`Content`].
pub fn min_bounds(&self) -> Size {
self.0.borrow().editor.min_bounds()
}

/// Returns whether or not the the [`Content`] is empty.
pub fn is_empty(&self) -> bool {
self.0.borrow().editor.is_empty()
Expand Down