Skip to main content

Chunk

Struct Chunk 

Source
pub struct Chunk {
    pub transform: Id,
    pub space: Space,
    pub origin: Vec2,
    pub commands: Vec<Command>,
    pub cut: Option<Rect>,
    pub covers: Vec<Rect>,
    pub bounds: Option<Rect>,
    pub action: Option<(String, Rect)>,
    pub made: Made,
    /* private fields */
}
Expand description

One scene node’s own commands, in its own coordinates, and their index.

Fields§

§transform: Id§space: Space

The space its coordinates are in: the design’s, or a run child’s.

§origin: Vec2

Where its coordinates’ origin is in its space’s.

§commands: Vec<Command>§cut: Option<Rect>

What cuts it in its space’s coordinates: its clipping frames’ boxes, those inside its space.

§covers: Vec<Rect>

What it covers for the drawing’s area, in its own coordinates, uncut: each shape, line and blur by itself.

§bounds: Option<Rect>

What its commands can touch in the design’s coordinates, cut — None when that is nothing.

§action: Option<(String, Rect)>

Its node’s interaction, if it has one, in its own coordinates: the box (0, 0, width, height).

§made: Made

The property-tree nodes its own layers made.

Implementations§

Source§

impl Chunk

Source

pub fn new( transform: Id, space: Space, origin: Vec2, (commands, made): (Vec<Command>, Made), covers: Vec<KRect>, action: Option<(String, KRect)>, cut: Option<KRect>, ) -> Chunk

Source

pub fn moved(self, origin: Vec2, cut: Option<KRect>) -> Chunk

The chunk with its origin at origin and cut by cut.

Source

pub fn cover(&self) -> Option<KRect>

What it covers in the design’s coordinates for the drawing’s area: each cover cut by itself, then joined.

Source§

impl Chunk

Source

pub fn hit(&self) -> Option<Hit>

Where its node can be clicked, in its space’s coordinates.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Chunk

§

impl !UnwindSafe for Chunk

§

impl Freeze for Chunk

§

impl Send for Chunk

§

impl Sync for Chunk

§

impl Unpin for Chunk

§

impl UnsafeUnpin for Chunk

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.