pub struct HighlightedRect {
pub rect: LogicalRect,
pub angle: f32,
pub parent_origin: LogicalPoint,
pub parent_rotation: f32,
}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.
parent_origin: LogicalPointAbsolute origin of this instance’s parent coordinate system (in root coordinates).
rect.origin - parent_origin yields the element’s position relative to its parent,
which matches the x/y properties written to the source. This is computed 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.
Both values are in root coordinates, so the subtraction only recovers the source x/y
while the parent frame is axis-aligned and unscaled — recovering it under a rotated or
scaled ancestor would additionally need to map the delta through the inverse ancestor
transform.
parent_rotation: f32Absolute 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 the rotation-angle/transform-rotation property written to the source.
Implementations§
Source§impl HighlightedRect
impl HighlightedRect
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.