Skip to content

Commit d0e8416

Browse files
committed
Expose bounds and min_bounds publicly from text_editor::Content
1 parent d188d6f commit d0e8416

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

widget/src/text_editor.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,16 @@ where
698698
Some(self.line(0)?.ending)
699699
}
700700

701+
/// Returns the current boundaries of the [`Content`].
702+
pub fn bounds(&self) -> Size {
703+
self.0.borrow().editor.bounds()
704+
}
705+
706+
/// Returns the minimum boundaries to fit the current text in the [`Content`].
707+
pub fn min_bounds(&self) -> Size {
708+
self.0.borrow().editor.min_bounds()
709+
}
710+
701711
/// Returns whether or not the the [`Content`] is empty.
702712
pub fn is_empty(&self) -> bool {
703713
self.0.borrow().editor.is_empty()

0 commit comments

Comments
 (0)