#[non_exhaustive]pub enum ContentSpace {
Frame,
Fit(Size),
View(Binding<ZoomView>, Size),
}Expand description
How the coordinates of a widget drawn over content relate to the screen, so that a selection or a crop is told in the units of the content whatever the zoom.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Frame
The widget’s own box is the content, one unit per logical pixel from its top left corner.
Fit(Size)
Content of this size, shown whole and centered in the box, as an image that fits.
View(Binding<ZoomView>, Size)
Content of this size where a ZoomPanView with the same
ZoomView shows it. Put the widget exactly over that view.
Implementations§
Source§impl ContentSpace
impl ContentSpace
Sourcepub fn placed(&self, frame: Rect) -> Rect
pub fn placed(&self, frame: Rect) -> Rect
Where the whole content lands on screen, for a widget at frame.
Sourcepub fn content_size(&self, frame: Rect) -> Size
pub fn content_size(&self, frame: Rect) -> Size
The size of the content in its own units.
Sourcepub fn to_content(&self, frame: Rect, at: Point) -> Point
pub fn to_content(&self, frame: Rect, at: Point) -> Point
A point on screen, in the units of the content.
Sourcepub fn rect_to_screen(&self, frame: Rect, rect: Rect) -> Rect
pub fn rect_to_screen(&self, frame: Rect, rect: Rect) -> Rect
A rectangle of the content, on screen.
Trait Implementations§
Source§impl Clone for ContentSpace
impl Clone for ContentSpace
Source§fn clone(&self) -> ContentSpace
fn clone(&self) -> ContentSpace
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 moreSource§impl Debug for ContentSpace
impl Debug for ContentSpace
Source§impl Default for ContentSpace
impl Default for ContentSpace
Source§fn default() -> ContentSpace
fn default() -> ContentSpace
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ContentSpace
impl !Send for ContentSpace
impl !Sync for ContentSpace
impl !UnwindSafe for ContentSpace
impl Freeze for ContentSpace
impl Unpin for ContentSpace
impl UnsafeUnpin for ContentSpace
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