pub struct TextDimensions {
pub width: f32,
pub height: f32,
pub offset_y: f32,
}Expand description
World space dimensions of the text, measured by “measure_text” function
Fields§
§width: f32Distance from very left to very right of the rasterized text
height: f32Distance from the bottom to the top of the text.
offset_y: f32Height offset from the baseline of the text. “draw_text(.., X, Y, ..)” will be rendered in a “Rect::new(X, Y - dimensions.offset_y, dimensions.width, dimensions.height)” For reference check “text_measures” example.
Trait Implementations§
Source§impl Clone for TextDimensions
impl Clone for TextDimensions
Source§fn clone(&self) -> TextDimensions
fn clone(&self) -> TextDimensions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextDimensions
impl Debug for TextDimensions
Source§impl Default for TextDimensions
impl Default for TextDimensions
Source§fn default() -> TextDimensions
fn default() -> TextDimensions
Returns the “default value” for a type. Read more
impl Copy for TextDimensions
Auto Trait Implementations§
impl Freeze for TextDimensions
impl RefUnwindSafe for TextDimensions
impl Send for TextDimensions
impl Sync for TextDimensions
impl Unpin for TextDimensions
impl UnwindSafe for TextDimensions
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