pub struct GridLayout { /* private fields */ }Expand description
Pixel geometry of a grid, derived from its columns and the font’s metrics.
Column edges and baselines are whole pixels, so text is positioned identically every frame and glyphs stay crisp. All sizes are physical pixels.
Implementations§
Source§impl GridLayout
impl GridLayout
Sourcepub fn new(columns: &[Column], rows: u32, glyphs: &mut GlyphMap) -> Self
pub fn new(columns: &[Column], rows: u32, glyphs: &mut GlyphMap) -> Self
Layout for rows data rows (plus a header) of columns, drawn with glyphs.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Number of columns.
Sourcepub fn row_height(&self) -> u32
pub fn row_height(&self) -> u32
Row pitch in pixels.
Sourcepub fn char_width(&self) -> f32
pub fn char_width(&self) -> f32
Advance of the font’s 0: the unit column widths are given in.
Sourcepub fn height(&self) -> u32
pub fn height(&self) -> u32
Total grid height in pixels: header plus data rows, padding included.
Sourcepub fn column_width(&self, index: usize) -> u32
pub fn column_width(&self, index: usize) -> u32
Sourcepub fn column_chars(&self, index: usize) -> u32
pub fn column_chars(&self, index: usize) -> u32
Sourcepub fn baseline_y(&self, row: u32) -> f32
pub fn baseline_y(&self, row: u32) -> f32
Baseline of grid row row (0 is the header), a whole pixel.
Sourcepub fn max_instances(&self) -> usize
pub fn max_instances(&self) -> usize
Instances needed for a full frame in the worst case: the header bar, and per row a stripe, a background per cell and a glyph per character of every column.
Trait Implementations§
Source§impl Clone for GridLayout
impl Clone for GridLayout
Source§impl Debug for GridLayout
impl Debug for GridLayout
Source§impl PartialEq for GridLayout
impl PartialEq for GridLayout
impl StructuralPartialEq for GridLayout
Auto Trait Implementations§
impl Freeze for GridLayout
impl RefUnwindSafe for GridLayout
impl Send for GridLayout
impl Sync for GridLayout
impl Unpin for GridLayout
impl UnsafeUnpin for GridLayout
impl UnwindSafe for GridLayout
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