pub struct ScreenDescriptor {
pub size_in_pixels: [u32; 2],
pub pixels_per_point: f32,
}Available on crate feature
egui only.Expand description
The target a UI frame is drawn into and the density it is drawn at.
The two are needed together and in opposite units, which is the easiest
thing to get wrong here: egui tessellates in logical points, so the
projection takes the point size, while a scissor rectangle is in physical
pixels, so the clip rectangles are scaled by Self::pixels_per_point.
Fields§
§size_in_pixels: [u32; 2]The target’s size in physical pixels.
pixels_per_point: f32How many physical pixels one logical point covers.
Implementations§
Source§impl ScreenDescriptor
impl ScreenDescriptor
Sourcepub fn size_in_points(self) -> [f32; 2]
pub fn size_in_points(self) -> [f32; 2]
The target’s size in logical points, which is what the UI’s projection
and its RawInput::screen_rect are expressed in.
Trait Implementations§
Source§impl Clone for ScreenDescriptor
impl Clone for ScreenDescriptor
impl Copy for ScreenDescriptor
Source§impl Debug for ScreenDescriptor
impl Debug for ScreenDescriptor
Source§impl PartialEq for ScreenDescriptor
impl PartialEq for ScreenDescriptor
impl StructuralPartialEq for ScreenDescriptor
Auto Trait Implementations§
impl Forget for ScreenDescriptor
impl Freeze for ScreenDescriptor
impl RefUnwindSafe for ScreenDescriptor
impl Send for ScreenDescriptor
impl Sync for ScreenDescriptor
impl Unpin for ScreenDescriptor
impl UnsafeUnpin for ScreenDescriptor
impl UnwindSafe for ScreenDescriptor
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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