pub struct VnClipGeometry {
pub fill_rule: VnFillRule,
pub segments: Vec<[f32; 4]>,
pub bounds: Bounds<ScaledPixels>,
}Expand description
vue-native fork: a clip shape flattened into line segments, in window device pixels. What the renderer evaluates per pixel and the hit test asks.
Fields§
§fill_rule: VnFillRuleHow the winding number decides inside.
segments: Vec<[f32; 4]>The edges, [x0, y0, x1, y1]; every subpath is closed.
bounds: Bounds<ScaledPixels>The box around the segments.
Implementations§
Source§impl VnClipGeometry
impl VnClipGeometry
Sourcepub fn rect(bounds: Bounds<ScaledPixels>) -> Self
pub fn rect(bounds: Bounds<ScaledPixels>) -> Self
A rectangle, in window device pixels.
Sourcepub fn new(
outline: &VnClipOutline,
scale_factor: f32,
transform: TransformationMatrix,
) -> Self
pub fn new( outline: &VnClipOutline, scale_factor: f32, transform: TransformationMatrix, ) -> Self
Flattens outline (logical pixels, the element’s own frame) into
window device pixels: scaled by scale_factor, then through
transform (a device-space matrix, as
crate::Window::element_transform). Curves are cut to
VN_CLIP_TOLERANCE in device pixels.
Sourcepub fn winding(&self, p: [f32; 2]) -> i32
pub fn winding(&self, p: [f32; 2]) -> i32
The winding number of the shape around p (device pixels): the
signed count of edges crossing the ray from p to the right, upward
edges counting one way and downward ones the other.
Trait Implementations§
Source§impl Clone for VnClipGeometry
impl Clone for VnClipGeometry
Source§impl Debug for VnClipGeometry
impl Debug for VnClipGeometry
Source§impl Default for VnClipGeometry
impl Default for VnClipGeometry
Source§impl PartialEq for VnClipGeometry
impl PartialEq for VnClipGeometry
impl StructuralPartialEq for VnClipGeometry
Auto Trait Implementations§
impl Forget for VnClipGeometry
impl Freeze for VnClipGeometry
impl Move for VnClipGeometry
impl RefUnwindSafe for VnClipGeometry
impl Send for VnClipGeometry
impl Sync for VnClipGeometry
impl Unpin for VnClipGeometry
impl UnsafeUnpin for VnClipGeometry
impl UnwindSafe for VnClipGeometry
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more