pub struct LogicalViewport { /* private fields */ }Expand description
Logical pixel dimensions of the viewport currently being drawn into.
Implementations§
Source§impl LogicalViewport
impl LogicalViewport
Sourcepub fn new(width: f32, height: f32) -> Result<Self, LogicalViewportError>
pub fn new(width: f32, height: f32) -> Result<Self, LogicalViewportError>
Builds a viewport from logical pixel dimensions.
Both dimensions must be finite and strictly positive.
Sourcepub fn center(self) -> LogicalScreenPosition
pub fn center(self) -> LogicalScreenPosition
Returns the center point in logical screen pixel coordinates.
Trait Implementations§
Source§impl Clone for LogicalViewport
impl Clone for LogicalViewport
Source§fn clone(&self) -> LogicalViewport
fn clone(&self) -> LogicalViewport
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 LogicalViewport
Source§impl Debug for LogicalViewport
impl Debug for LogicalViewport
Source§impl PartialEq for LogicalViewport
impl PartialEq for LogicalViewport
impl StructuralPartialEq for LogicalViewport
Auto Trait Implementations§
impl Freeze for LogicalViewport
impl RefUnwindSafe for LogicalViewport
impl Send for LogicalViewport
impl Sync for LogicalViewport
impl Unpin for LogicalViewport
impl UnsafeUnpin for LogicalViewport
impl UnwindSafe for LogicalViewport
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