pub enum TextureFit {
Contain,
Cover,
Fill,
}Expand description
A leaf drawing an externally rendered scene texture — a video frame, a
camera preview, a 3D view — by the id its producer registered it under
(for a frame source, texture::TextureRegistration::scene_texture_id).
texture_view places it with a TextureFit (given the texture’s own
extent, .source_size(..)), clips it to .corner_radius(..), and takes
an accessible .label(..). A texture view inside a retained subtree keeps
that subtree from being replayed from cache — see the widget’s own docs.
How a TextureView places its texture in the widget’s box.
Variants§
Contain
Scale (preserving aspect ratio) to fit entirely inside the box, centred; the other axis is letterboxed.
Cover
Scale (preserving aspect ratio) to cover the box entirely, centred; the overflow is clipped to the box.
Fill
Stretch to exactly the box, ignoring aspect ratio.
Trait Implementations§
Source§impl Clone for TextureFit
impl Clone for TextureFit
Source§fn clone(&self) -> TextureFit
fn clone(&self) -> TextureFit
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 TextureFit
Source§impl Debug for TextureFit
impl Debug for TextureFit
Source§impl Default for TextureFit
impl Default for TextureFit
Source§fn default() -> TextureFit
fn default() -> TextureFit
impl Eq for TextureFit
Source§impl PartialEq for TextureFit
impl PartialEq for TextureFit
impl StructuralPartialEq for TextureFit
Auto Trait Implementations§
impl Freeze for TextureFit
impl RefUnwindSafe for TextureFit
impl Send for TextureFit
impl Sync for TextureFit
impl Unpin for TextureFit
impl UnsafeUnpin for TextureFit
impl UnwindSafe for TextureFit
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.