pub(crate) struct PinchZoom {
    zoom_factor: f32,
    transform: Transform2D<f32, DevicePixel, DevicePixel>,
    unscaled_viewport_size: DeviceSize,
}Expand description
A PinchZoom describes the pinch zoom viewport of a WebView. This is used to
track the current pinch zoom transformation and to clamp all pinching and panning
to the unscaled WebView viewport.
Fields§
§zoom_factor: f32§transform: Transform2D<f32, DevicePixel, DevicePixel>§unscaled_viewport_size: DeviceSizeImplementations§
Source§impl PinchZoom
 
impl PinchZoom
pub(crate) fn new(webview_rect: DeviceRect) -> Self
pub(crate) fn transform(&self) -> Transform2D<f32, DevicePixel, DevicePixel>
pub(crate) fn zoom_factor(&self) -> Scale<f32, DevicePixel, DevicePixel>
fn set_transform( &mut self, transform: Transform2D<f32, DevicePixel, DevicePixel>, )
pub(crate) fn zoom(&mut self, magnification: f32, new_center: DevicePoint)
Sourcepub(crate) fn pan(
    &mut self,
    scroll: &mut Scroll,
    scale: Scale<f32, CSSPixel, DevicePixel>,
)
 
pub(crate) fn pan( &mut self, scroll: &mut Scroll, scale: Scale<f32, CSSPixel, DevicePixel>, )
Pan the pinch zoom viewoprt by the given Scroll and if it is a delta,
modify the delta to reflect the remaining unused scroll delta.
Sourcepub(crate) fn pan_with_device_scroll(
    &mut self,
    scroll: Scroll,
    scale: Scale<f32, CSSPixel, DevicePixel>,
) -> DeviceVector2D
 
pub(crate) fn pan_with_device_scroll( &mut self, scroll: Scroll, scale: Scale<f32, CSSPixel, DevicePixel>, ) -> DeviceVector2D
Pan the pinch zoom viewport by the given delta and return the remaining device pixel value that was unused.
Trait Implementations§
impl Copy for PinchZoom
impl StructuralPartialEq for PinchZoom
Auto Trait Implementations§
impl Freeze for PinchZoom
impl RefUnwindSafe for PinchZoom
impl Send for PinchZoom
impl Sync for PinchZoom
impl Unpin for PinchZoom
impl UnwindSafe for PinchZoom
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> Instrument for T
 
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
 
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
 
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
 
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
 
fn maybe_boxed(self) -> T
Convert