diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index 11ff833bea..79405b30e1 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -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()