pub struct UnifiedLayout {
pub items: Vec<PositionedItem>,
pub overflow: OverflowInfo,
}Fields§
§items: Vec<PositionedItem>§overflow: OverflowInfoInformation about content that did not fit.
Implementations§
Source§impl UnifiedLayout
impl UnifiedLayout
Sourcepub fn bounds(&self) -> Rect
pub fn bounds(&self) -> Rect
Calculate the bounding box of all positioned items. This is computed on-demand rather than cached.
pub fn is_empty(&self) -> bool
pub fn last_baseline(&self) -> Option<f32>
Sourcepub fn hittest_cursor(&self, point: LogicalPosition) -> Option<TextCursor>
pub fn hittest_cursor(&self, point: LogicalPosition) -> Option<TextCursor>
Takes a point relative to the layout’s origin and returns the closest logical cursor position.
This is the unified hit-testing implementation. The old hit_test_to_cursor
method is deprecated in favor of this one.
Sourcepub fn get_selection_rects(&self, range: &SelectionRange) -> Vec<LogicalRect>
pub fn get_selection_rects(&self, range: &SelectionRange) -> Vec<LogicalRect>
Given a logical selection range, returns a vector of visual rectangles that cover the selected text, in the layout’s coordinate space.
Sourcepub fn get_cursor_rect(&self, cursor: &TextCursor) -> Option<LogicalRect>
pub fn get_cursor_rect(&self, cursor: &TextCursor) -> Option<LogicalRect>
Calculates the visual rectangle for a cursor at a given logical position.
Sourcepub fn get_first_cluster_cursor(&self) -> Option<TextCursor>
pub fn get_first_cluster_cursor(&self) -> Option<TextCursor>
Get a cursor at the first cluster (leading edge) in the layout.
Sourcepub fn get_last_cluster_cursor(&self) -> Option<TextCursor>
pub fn get_last_cluster_cursor(&self) -> Option<TextCursor>
Get a cursor at the last cluster (trailing edge) in the layout.
Sourcepub fn move_cursor_left(
&self,
cursor: TextCursor,
debug: &mut Option<Vec<String>>,
) -> TextCursor
pub fn move_cursor_left( &self, cursor: TextCursor, debug: &mut Option<Vec<String>>, ) -> TextCursor
Moves a cursor one visual unit to the left, handling line wrapping and Bidi text.
Sourcepub fn move_cursor_right(
&self,
cursor: TextCursor,
debug: &mut Option<Vec<String>>,
) -> TextCursor
pub fn move_cursor_right( &self, cursor: TextCursor, debug: &mut Option<Vec<String>>, ) -> TextCursor
Moves a cursor one visual unit to the right.
Sourcepub fn move_cursor_up(
&self,
cursor: TextCursor,
goal_x: &mut Option<f32>,
debug: &mut Option<Vec<String>>,
) -> TextCursor
pub fn move_cursor_up( &self, cursor: TextCursor, goal_x: &mut Option<f32>, debug: &mut Option<Vec<String>>, ) -> TextCursor
Moves a cursor up one line, attempting to preserve the horizontal column.
Sourcepub fn move_cursor_down(
&self,
cursor: TextCursor,
goal_x: &mut Option<f32>,
debug: &mut Option<Vec<String>>,
) -> TextCursor
pub fn move_cursor_down( &self, cursor: TextCursor, goal_x: &mut Option<f32>, debug: &mut Option<Vec<String>>, ) -> TextCursor
Moves a cursor down one line, attempting to preserve the horizontal column.
Sourcepub fn move_cursor_to_line_start(
&self,
cursor: TextCursor,
debug: &mut Option<Vec<String>>,
) -> TextCursor
pub fn move_cursor_to_line_start( &self, cursor: TextCursor, debug: &mut Option<Vec<String>>, ) -> TextCursor
Moves a cursor to the visual start of its current line.
Sourcepub fn move_cursor_to_line_end(
&self,
cursor: TextCursor,
debug: &mut Option<Vec<String>>,
) -> TextCursor
pub fn move_cursor_to_line_end( &self, cursor: TextCursor, debug: &mut Option<Vec<String>>, ) -> TextCursor
Moves a cursor to the visual end of its current line.
Trait Implementations§
Source§impl Clone for UnifiedLayout
impl Clone for UnifiedLayout
Source§fn clone(&self) -> UnifiedLayout
fn clone(&self) -> UnifiedLayout
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for UnifiedLayout
impl RefUnwindSafe for UnifiedLayout
impl Send for UnifiedLayout
impl Sync for UnifiedLayout
impl Unpin for UnifiedLayout
impl UnwindSafe for UnifiedLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more