#[non_exhaustive]pub struct MarkerContext {
pub position: Pos2,
pub zoom: f32,
pub kind: SteadyAnimation,
pub node_id: usize,
}Expand description
The context passed to NodeTemplate::marker_ui.
#[non_exhaustive], like NotificationContext, so a future field can
be added here without another breaking change.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.position: Pos2The node’s screen position: already scaled by zoom and translated
to the viewport origin.
zoom: f32Multiply every size you draw by this so it scales with the map.
kind: SteadyAnimationWhich persistent effect to draw. For a node’s own lasting state (set
through Map::node’s halo/blink/orbit)
this is whichever of those was requested; for a plain marker
(registered with Map::update_marker)
it is always MapSettings::marker_animation, since every marker
shares that one setting. There is no way from inside this hook to
tell the two cases apart – only which SteadyAnimation to draw
for whichever one it is.
node_id: usizeThe id of the node the state/marker belongs to (for a marker: the id it points at, not the marker’s own id).
Trait Implementations§
Source§impl Clone for MarkerContext
impl Clone for MarkerContext
Source§fn clone(&self) -> MarkerContext
fn clone(&self) -> MarkerContext
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 MarkerContext
Auto Trait Implementations§
impl Freeze for MarkerContext
impl RefUnwindSafe for MarkerContext
impl Send for MarkerContext
impl Sync for MarkerContext
impl Unpin for MarkerContext
impl UnsafeUnpin for MarkerContext
impl UnwindSafe for MarkerContext
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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