pub struct BoxTransform {
pub rect: Rect,
pub angle: f32,
pub pivot: Point,
}Expand description
A rectangle turned around a point, which is what a TransformHandles edits.
Fields§
§rect: RectThe box before turning, in the units of the content.
angle: f32How far it is turned clockwise, in degrees.
pivot: PointThe point it turns around, as a share of the box: (0.5, 0.5) is its middle.
Implementations§
Source§impl BoxTransform
impl BoxTransform
Sourcepub const fn rotated(self, angle: f32) -> Self
pub const fn rotated(self, angle: f32) -> Self
The same box turned clockwise by this many degrees.
Sourcepub fn pivot_point(&self) -> Point
pub fn pivot_point(&self) -> Point
The point it turns around, in the units of the content.
Sourcepub fn to_world(&self, local: Point) -> Point
pub fn to_world(&self, local: Point) -> Point
Where a point of the upright box ends up once turned.
Sourcepub fn to_local(&self, world: Point) -> Point
pub fn to_local(&self, world: Point) -> Point
The point of the upright box that ends up at world once turned.
Trait Implementations§
Source§impl Clone for BoxTransform
impl Clone for BoxTransform
Source§fn clone(&self) -> BoxTransform
fn clone(&self) -> BoxTransform
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BoxTransform
Source§impl Debug for BoxTransform
impl Debug for BoxTransform
Source§impl PartialEq for BoxTransform
impl PartialEq for BoxTransform
impl StructuralPartialEq for BoxTransform
Auto Trait Implementations§
impl Freeze for BoxTransform
impl RefUnwindSafe for BoxTransform
impl Send for BoxTransform
impl Sync for BoxTransform
impl Unpin for BoxTransform
impl UnsafeUnpin for BoxTransform
impl UnwindSafe for BoxTransform
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