pub struct ZoomView {
pub scale: f32,
pub center: Point,
pub fit: bool,
pub viewport: Size,
}Expand description
How a picture is being looked at: how much it is enlarged and which part is in the middle.
ZoomPanView, ZoomControl and Minimap share one through a Binding, and each
changes what it is responsible for.
While fit is on, ZoomPanView keeps the whole content in view and writes the scale
this takes, so the value also reads correctly when the window is resized.
Fields§
§scale: f32Screen pixels per unit of content: 1 is 100%.
center: PointThe point of the content in the middle of the view, from 0 to 1 on each axis.
fit: boolFollows the view’s size to show the whole content.
viewport: SizeThe size of the view on screen, written by ZoomPanView and read by Minimap.
Implementations§
Trait Implementations§
impl Copy for ZoomView
impl StructuralPartialEq for ZoomView
Auto Trait Implementations§
impl Freeze for ZoomView
impl RefUnwindSafe for ZoomView
impl Send for ZoomView
impl Sync for ZoomView
impl Unpin for ZoomView
impl UnsafeUnpin for ZoomView
impl UnwindSafe for ZoomView
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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