pub struct ViewportPixels {
pub width: u32,
pub height: u32,
}Expand description
The size of the area a picture is being shown in, in physical pixels — the buffer’s unit, not the widget tree’s.
Named rather than a bare (u32, u32) because this is the one place
logical and physical coordinates meet, and mixing them is the failure
CLAUDE.md records twice: a 1.6-scale output makes a logical window
1.6x smaller than the buffer it draws into, so a budget computed from
logical pixels would decode a picture visibly soft on exactly the
displays where it matters most.
Fields§
§width: u32§height: u32Implementations§
Source§impl ViewportPixels
impl ViewportPixels
Sourcepub fn from_logical(width: f32, height: f32, scale: f32) -> ViewportPixels
pub fn from_logical(width: f32, height: f32, scale: f32) -> ViewportPixels
From a logical size and the output’s scale factor. The conversion is here, once, so no caller has to remember which way it goes.
Trait Implementations§
Source§impl Clone for ViewportPixels
impl Clone for ViewportPixels
impl Copy for ViewportPixels
Source§impl Debug for ViewportPixels
impl Debug for ViewportPixels
impl Eq for ViewportPixels
Source§impl PartialEq for ViewportPixels
impl PartialEq for ViewportPixels
impl StructuralPartialEq for ViewportPixels
Auto Trait Implementations§
impl Freeze for ViewportPixels
impl RefUnwindSafe for ViewportPixels
impl Send for ViewportPixels
impl Sync for ViewportPixels
impl Unpin for ViewportPixels
impl UnsafeUnpin for ViewportPixels
impl UnwindSafe for ViewportPixels
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