#[non_exhaustive]pub struct TransformFrame {
pub rect: Rect,
pub rotation: f32,
pub count: usize,
}Expand description
The box the handles are drawn on.
rect is stated in the frame’s own basis: a point p of
it sits at Rot(rotation) · p in scene coordinates.
#[non_exhaustive]: the crate hands this to consumer code and asks for it
back — a ProposedChange is handed the proposed
frame and may answer with an adjusted one — so it is both a receive type and
a construct type. Build one with new.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.rect: RectThe union of the selection, in the frame’s own (unrotated) basis.
rotation: f32The frame’s angle, in radians. Non-zero only for a single-item selection that carries its own rotation — a multi-item union has no well-defined angle, so its frame is axis-aligned.
count: usizeHow many selection roots the frame encloses.
Implementations§
Source§impl TransformFrame
impl TransformFrame
Sourcepub fn new(rect: Rect, rotation: f32, count: usize) -> Self
pub fn new(rect: Rect, rotation: f32, count: usize) -> Self
A frame stated field by field — the constructor
#[non_exhaustive] takes the place of a struct literal for.
A geometry constraint that wants to adjust the frame it was handed normally derives one from that frame rather than building it here; this is for the constraint that states its answer outright, and for a consumer’s own tests.
Sourcepub fn to_scene(&self, p: Point) -> Point
pub fn to_scene(&self, p: Point) -> Point
Map a point of this frame’s basis into scene coordinates.
Sourcepub fn from_scene(&self, p: Point) -> Point
pub fn from_scene(&self, p: Point) -> Point
Map a scene point into this frame’s basis.
Sourcepub fn centre_scene(&self) -> Point
pub fn centre_scene(&self) -> Point
The frame’s centre, in scene coordinates.
Sourcepub fn outline(&self, padding: f32) -> Rect
pub fn outline(&self, padding: f32) -> Rect
The outline the chrome is drawn on: rect grown by
padding scene units on every side.
Sourcepub fn handle_point(
&self,
handle: TransformHandle,
padding: f32,
rotate_offset: f32,
) -> Point
pub fn handle_point( &self, handle: TransformHandle, padding: f32, rotate_offset: f32, ) -> Point
Where handle sits, in this frame’s basis.
padding and rotate_offset are scene units (a caller converts from
screen pixels by dividing by the live view scale, so the chrome keeps a
constant on-screen size at any zoom).
Trait Implementations§
Source§impl Clone for TransformFrame
impl Clone for TransformFrame
Source§fn clone(&self) -> TransformFrame
fn clone(&self) -> TransformFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TransformFrame
Source§impl Debug for TransformFrame
impl Debug for TransformFrame
Source§impl PartialEq for TransformFrame
impl PartialEq for TransformFrame
impl StructuralPartialEq for TransformFrame
Auto Trait Implementations§
impl Freeze for TransformFrame
impl RefUnwindSafe for TransformFrame
impl Send for TransformFrame
impl Sync for TransformFrame
impl Unpin for TransformFrame
impl UnsafeUnpin for TransformFrame
impl UnwindSafe for TransformFrame
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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