pub struct CellGeometry {
pub glyph_w: u8,
pub glyph_h: u8,
pub scale: u16,
}Expand description
The pixel geometry of a fixed cell grid: a glyph size and an integer scale.
Presenter::cell_size’s contract (physical pixels,
glyph x scale, never DPI-auto-scaled) had no code embodiment: each graphical backend
re-derived glyph_w * scale (and cols * cell_w for the surface) on its own, in slightly
different integer types, so the shared rule could drift. This is that rule as one small,
const, testable value type. A backend stores one and returns cell_size
from Presenter::cell_size.
Fields§
§glyph_w: u8Glyph width in unscaled font pixels.
glyph_h: u8Glyph height in unscaled font pixels.
scale: u16Integer pixel scale: each glyph pixel becomes a scale x scale block of physical pixels.
Implementations§
Source§impl CellGeometry
impl CellGeometry
Sourcepub const fn new(glyph_w: u8, glyph_h: u8, scale: u16) -> Self
pub const fn new(glyph_w: u8, glyph_h: u8, scale: u16) -> Self
A geometry for glyph_w x glyph_h glyphs drawn at integer scale.
Trait Implementations§
Source§impl Clone for CellGeometry
impl Clone for CellGeometry
Source§fn clone(&self) -> CellGeometry
fn clone(&self) -> CellGeometry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CellGeometry
Source§impl Debug for CellGeometry
impl Debug for CellGeometry
impl Eq for CellGeometry
Source§impl PartialEq for CellGeometry
impl PartialEq for CellGeometry
impl StructuralPartialEq for CellGeometry
Auto Trait Implementations§
impl Freeze for CellGeometry
impl RefUnwindSafe for CellGeometry
impl Send for CellGeometry
impl Sync for CellGeometry
impl Unpin for CellGeometry
impl UnsafeUnpin for CellGeometry
impl UnwindSafe for CellGeometry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.