pub struct AnchorRect {
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
}Expand description
A rectangle in logical points of the presenting window’s coordinate space, origin top-left — where an action sheet’s popover points from.
§Getting one
frust’s logical pixels are view points on iOS (frust-shell-ios’s
touch/IME contract: logical points pass through with no scale division),
and the default shell’s frust view fills its window, so any rect frust
reports in window space is already an anchor, unconverted:
- A native control’s slot — the rect a
platform_viewslot publishes each paint (PlatformViewFrame::rect, the absolute painted rect the platform view is positioned from) is exactly where the control sits; anchor a “more actions” sheet on the button that opened it. - A frust widget — its window-space rect: an overlay surface’s
window_rect(), or the origin a layout you control accumulates down to the widget plus its size. - A point — a zero-size rect at a tap location (the popover arrow points at the point).
The iOS arm converts it into the presenting controller’s view with
convertRect:fromView:nil (window base coordinates), so it also holds
when that controller’s view is not full-window (a form sheet). A rect
outside the window is passed to UIKit as-is; UIKit clamps the popover
onto the screen.
Fields§
§x: f64Left edge.
y: f64Top edge.
width: f64Width, non-negative.
height: f64Height, non-negative.
Trait Implementations§
Source§impl Clone for AnchorRect
impl Clone for AnchorRect
impl Copy for AnchorRect
Source§impl Debug for AnchorRect
impl Debug for AnchorRect
Source§impl Default for AnchorRect
impl Default for AnchorRect
Source§impl PartialEq for AnchorRect
impl PartialEq for AnchorRect
impl StructuralPartialEq for AnchorRect
Auto Trait Implementations§
impl Freeze for AnchorRect
impl RefUnwindSafe for AnchorRect
impl Send for AnchorRect
impl Sync for AnchorRect
impl Unpin for AnchorRect
impl UnsafeUnpin for AnchorRect
impl UnwindSafe for AnchorRect
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<T> Brush for 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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.