pub struct ClipPaint<'a> {
pub clip: &'a Clip,
pub track: &'a Track,
pub rect: Rect,
pub visible: Rect,
pub content: Rect,
pub lanes: &'a Lanes,
pub scale: &'a TimeScale,
pub selected: bool,
pub hovered: bool,
pub tokens: &'a TimelineTokens,
}Expand description
What a ClipPainter draws a clip with: the clip, its track, where it is
on screen, and the mapping of time.
Fields§
§clip: &'a Clip§track: &'a Track§rect: RectThe whole clip, often wider than the lanes when zoomed in.
visible: RectThe part of it in view.
content: RectWhere its content goes: under its label when the track is tall enough, else the whole clip.
lanes: &'a LanesThe lanes, for Lanes::x_of and Lanes::time_at.
scale: &'a TimeScale§selected: bool§hovered: bool§tokens: &'a TimelineTokensImplementations§
Source§impl ClipPaint<'_>
impl ClipPaint<'_>
Sourcepub fn x_of_source(&self, source_time: f64) -> f32
pub fn x_of_source(&self, source_time: f64) -> f32
The x of the source’s source_time.
Sourcepub fn source_in_view(&self) -> (f64, f64)
pub fn source_in_view(&self) -> (f64, f64)
The source’s times in view: from, to.
Sourcepub fn text_color(&self) -> Color32
pub fn text_color(&self) -> Color32
The text its label is drawn in.
Sourcepub fn paint_label(&self, painter: &Painter)
pub fn paint_label(&self, painter: &Painter)
Its label at the top left of the part in view (so a long clip keeps
it in sight), as PlainClips draws it.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ClipPaint<'a>
impl<'a> RefUnwindSafe for ClipPaint<'a>
impl<'a> Send for ClipPaint<'a>
impl<'a> Sync for ClipPaint<'a>
impl<'a> Unpin for ClipPaint<'a>
impl<'a> UnsafeUnpin for ClipPaint<'a>
impl<'a> UnwindSafe for ClipPaint<'a>
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
§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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Converts
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>
Converts
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