Struct gpui2::LineLayout
source · pub struct LineLayout {
pub font_size: Pixels,
pub width: Pixels,
pub ascent: Pixels,
pub descent: Pixels,
pub runs: Vec<ShapedRun>,
pub len: usize,
}
Fields§
§font_size: Pixels
§width: Pixels
§ascent: Pixels
§descent: Pixels
§runs: Vec<ShapedRun>
§len: usize
Implementations§
source§impl LineLayout
impl LineLayout
pub fn index_for_x(&self, x: Pixels) -> Option<usize>
sourcepub fn closest_index_for_x(&self, x: Pixels) -> usize
pub fn closest_index_for_x(&self, x: Pixels) -> usize
closest_index_for_x returns the character boundary closest to the given x coordinate (e.g. to handle aligning up/down arrow keys)
pub fn x_for_index(&self, index: usize) -> Pixels
Trait Implementations§
source§impl Debug for LineLayout
impl Debug for LineLayout
source§impl Default for LineLayout
impl Default for LineLayout
source§fn default() -> LineLayout
fn default() -> LineLayout
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for LineLayout
impl Send for LineLayout
impl Sync for LineLayout
impl Unpin for LineLayout
impl UnwindSafe for LineLayout
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
Mutably borrows from an owned value. Read more