pub struct PaneCoordinateNormalizer {
pub viewport_origin_css: PanePointerPosition,
pub viewport_origin_cells: PanePointerPosition,
pub cell_width_css: u16,
pub cell_height_css: u16,
pub dpr: PaneScaleFactor,
pub zoom: PaneScaleFactor,
pub rounding: PaneCoordinateRoundingPolicy,
}Expand description
Coordinate normalization configuration and transform pipeline.
Fields§
§viewport_origin_css: PanePointerPosition§viewport_origin_cells: PanePointerPosition§cell_width_css: u16§cell_height_css: u16§dpr: PaneScaleFactor§zoom: PaneScaleFactor§rounding: PaneCoordinateRoundingPolicyImplementations§
Source§impl PaneCoordinateNormalizer
impl PaneCoordinateNormalizer
Sourcepub fn new(
viewport_origin_css: PanePointerPosition,
viewport_origin_cells: PanePointerPosition,
cell_width_css: u16,
cell_height_css: u16,
dpr: PaneScaleFactor,
zoom: PaneScaleFactor,
rounding: PaneCoordinateRoundingPolicy,
) -> Result<Self, PaneCoordinateNormalizationError>
pub fn new( viewport_origin_css: PanePointerPosition, viewport_origin_cells: PanePointerPosition, cell_width_css: u16, cell_height_css: u16, dpr: PaneScaleFactor, zoom: PaneScaleFactor, rounding: PaneCoordinateRoundingPolicy, ) -> Result<Self, PaneCoordinateNormalizationError>
Construct a validated coordinate normalizer.
Sourcepub fn normalize(
&self,
input: PaneInputCoordinate,
) -> Result<PaneNormalizedCoordinate, PaneCoordinateNormalizationError>
pub fn normalize( &self, input: PaneInputCoordinate, ) -> Result<PaneNormalizedCoordinate, PaneCoordinateNormalizationError>
Convert one raw coordinate into canonical pane cell space.
Trait Implementations§
Source§impl Clone for PaneCoordinateNormalizer
impl Clone for PaneCoordinateNormalizer
Source§fn clone(&self) -> PaneCoordinateNormalizer
fn clone(&self) -> PaneCoordinateNormalizer
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 PaneCoordinateNormalizer
impl Debug for PaneCoordinateNormalizer
Source§impl<'de> Deserialize<'de> for PaneCoordinateNormalizer
impl<'de> Deserialize<'de> for PaneCoordinateNormalizer
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PaneCoordinateNormalizer
impl PartialEq for PaneCoordinateNormalizer
Source§impl Serialize for PaneCoordinateNormalizer
impl Serialize for PaneCoordinateNormalizer
impl Copy for PaneCoordinateNormalizer
impl Eq for PaneCoordinateNormalizer
impl StructuralPartialEq for PaneCoordinateNormalizer
Auto Trait Implementations§
impl Freeze for PaneCoordinateNormalizer
impl RefUnwindSafe for PaneCoordinateNormalizer
impl Send for PaneCoordinateNormalizer
impl Sync for PaneCoordinateNormalizer
impl Unpin for PaneCoordinateNormalizer
impl UnsafeUnpin for PaneCoordinateNormalizer
impl UnwindSafe for PaneCoordinateNormalizer
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