pub struct ViewportState {
pub canvas_width: u32,
pub canvas_height: u32,
pub transform: ViewportTransform,
pub visible_bounds: (f64, f64, f64, f64),
pub zoom_level: u32,
}Expand description
Viewport state with transformation and bounds
Fields§
§canvas_width: u32Canvas width in pixels
canvas_height: u32Canvas height in pixels
transform: ViewportTransformViewport transformation
visible_bounds: (f64, f64, f64, f64)Visible bounds in world coordinates (min_x, min_y, max_x, max_y)
zoom_level: u32Current zoom level
Implementations§
Source§impl ViewportState
impl ViewportState
Sourcepub fn update_transform(&mut self, transform: ViewportTransform)
pub fn update_transform(&mut self, transform: ViewportTransform)
Updates the viewport transform
Sourcepub fn visible_tiles(&self, tile_size: u32) -> Vec<TileCoord>
pub fn visible_tiles(&self, tile_size: u32) -> Vec<TileCoord>
Returns the tiles visible in this viewport
Trait Implementations§
Source§impl Clone for ViewportState
impl Clone for ViewportState
Source§fn clone(&self) -> ViewportState
fn clone(&self) -> ViewportState
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 ViewportState
impl Debug for ViewportState
Source§impl PartialEq for ViewportState
impl PartialEq for ViewportState
impl StructuralPartialEq for ViewportState
Auto Trait Implementations§
impl Freeze for ViewportState
impl RefUnwindSafe for ViewportState
impl Send for ViewportState
impl Sync for ViewportState
impl Unpin for ViewportState
impl UnsafeUnpin for ViewportState
impl UnwindSafe for ViewportState
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