pub struct HighlightedRect {
pub rect: LogicalRect,
pub angle: f32,
pub renders_as_rectangle: bool,
pub local_rect: LogicalRect,
pub parent_transform: ItemTransform,
pub transform_rotation: f32,
pub corner_radii: CornerRadii,
}internal-highlight only.Expand description
The rectangle of an element, which may be rotated around its center.
Fields§
§rect: LogicalRectThe element’s geometry.
angle: f32In degrees, around the center of the element.
renders_as_rectangle: boolWhether rect and angle describe the element’s rendered shape.
The two of them describe a rotated rectangle.
An element renders as one while its own and its ancestors’ transforms keep its two axes
at a right angle.
A non-uniform scale combined with a rotation shears it into a parallelogram instead,
which only local_rect still describes.
local_rect: LogicalRectThe element’s rectangle in its parent’s coordinate system.
This is what the source x, y, width and height describe.
Unlike rect, no transform of the element or of any of its ancestors applies to it.
parent_transform: ItemTransformMaps this instance’s parent coordinate system to root coordinates.
Invert it to turn a position picked in root coordinates into one that can be written to the source. It is composed from the instance’s own ancestors, so it stays correct even if the element is positioned outside of (or with a negative offset relative to) its parent.
transform_rotation: f32Evaluated parent-relative rotation in degrees, including complete turns.
corner_radii: CornerRadiiEvaluated corner radii in logical pixels.
Implementations§
Source§impl HighlightedRect
impl HighlightedRect
Sourcepub fn parent_origin(&self) -> LogicalPoint
pub fn parent_origin(&self) -> LogicalPoint
Absolute origin of this instance’s parent coordinate system, in root coordinates.
Sourcepub fn parent_rotation(&self) -> f32
pub fn parent_rotation(&self) -> f32
Absolute rotation (in degrees) of this instance’s parent coordinate system.
angle - parent_rotation() yields the element’s own rotation relative to its parent,
which matches transform-rotation modulo complete turns.
Use transform_rotation to retain those turns.
Sourcepub fn contains(&self, position: LogicalPoint) -> bool
pub fn contains(&self, position: LogicalPoint) -> bool
Returns true if position lies inside the (potentially rotated) rectangle.
Trait Implementations§
Source§impl Clone for HighlightedRect
impl Clone for HighlightedRect
Source§fn clone(&self) -> HighlightedRect
fn clone(&self) -> HighlightedRect
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 HighlightedRect
Source§impl Debug for HighlightedRect
impl Debug for HighlightedRect
Source§impl Default for HighlightedRect
impl Default for HighlightedRect
Source§fn default() -> HighlightedRect
fn default() -> HighlightedRect
Auto Trait Implementations§
impl Freeze for HighlightedRect
impl RefUnwindSafe for HighlightedRect
impl Send for HighlightedRect
impl Sync for HighlightedRect
impl Unpin for HighlightedRect
impl UnsafeUnpin for HighlightedRect
impl UnwindSafe for HighlightedRect
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
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.