pub struct ViewportPos {
pub col: i32,
pub row: i32,
}Available on crate feature
kitty-graphics only.Expand description
The position of an image in the viewport.
The row value can be negative when the placement’s origin has scrolled above the top of the viewport. For example, a 4-row image that has scrolled up by 2 rows returns row=-2, meaning its top 2 rows are above the visible area but its bottom 2 rows are still on screen. Embedders should use these coordinates directly when computing the destination rectangle for rendering; the embedder is responsible for clipping the portion of the image that falls outside the viewport.
Fields§
§col: i32The column index relative to the viewport.
row: i32The row index relative to the viewport.
Trait Implementations§
Source§impl Clone for ViewportPos
impl Clone for ViewportPos
Source§fn clone(&self) -> ViewportPos
fn clone(&self) -> ViewportPos
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 ViewportPos
Source§impl Debug for ViewportPos
impl Debug for ViewportPos
Source§impl Default for ViewportPos
impl Default for ViewportPos
Source§fn default() -> ViewportPos
fn default() -> ViewportPos
Returns the “default value” for a type. Read more
impl Eq for ViewportPos
Source§impl PartialEq for ViewportPos
impl PartialEq for ViewportPos
Source§fn eq(&self, other: &ViewportPos) -> bool
fn eq(&self, other: &ViewportPos) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ViewportPos
Auto Trait Implementations§
impl Freeze for ViewportPos
impl RefUnwindSafe for ViewportPos
impl Send for ViewportPos
impl Sync for ViewportPos
impl Unpin for ViewportPos
impl UnsafeUnpin for ViewportPos
impl UnwindSafe for ViewportPos
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