MCPcopy Create free account
hub / github.com/donkeyteethUX/iced_plot / new

Method new

src/plot_overlay.rs:30–39  ·  view source on GitHub ↗

Create an external Iced element anchored at a plot position. The position is interpreted as normal data coordinates by default. Use [`PlotOverlay::with_axes_transform`] or [`PlotOverlay::with_transform`] for other coordinate systems.

(element: impl Into<Element<'a, Message>>, anchor_position: [f64; 2])

Source from the content-addressed store, hash-verified

28 /// [`PlotOverlay::with_axes_transform`] or [`PlotOverlay::with_transform`] for other
29 /// coordinate systems.
30 pub fn new(element: impl Into<Element<'a, Message>>, anchor_position: [f64; 2]) -> Self {
31 Self {
32 element: element.into(),
33 anchor_position,
34 anchor_position_transform: PositionTransform::identity(),
35 anchor_offset: [0.0, 0.0],
36 align_to_anchor_vertical: Vertical::Center,
37 align_to_anchor_horizontal: Horizontal::Center,
38 }
39 }
40
41 /// Set the plot position (in `[x,y]` coordinates) used as the overlay anchor.
42 pub fn with_anchor_position(mut self, anchor_position: [f64; 2]) -> Self {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected