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

Method view_shape_overlay

src/plot_widget.rs:746–770  ·  view source on GitHub ↗
(
        &'a self,
        shape: plot_overlay::PlotOverlay<'a, Message>,
    )

Source from the content-addressed store, hash-verified

744 fn view_plot_area<'a, Message, MapPlot>(
745 &'a self,
746 shapes_bottom: impl Iterator<Item = Element<'a, Message>>,
747 shapes_top: impl Iterator<Item = Element<'a, Message>>,
748 map_plot: MapPlot,
749 ) -> Element<'a, Message>
750 where
751 Message: 'a,
752 MapPlot: Fn(PlotUiMessage) -> Message + Copy + 'a,
753 {
754 let plot: Element<'a, PlotUiMessage> = match self.render_strategy {
755 PlotRenderStrategy::Shader => widget::shader(self)
756 .width(Length::Fill)
757 .height(Length::Fill)
758 .into(),
759 #[cfg(feature = "canvas")]
760 PlotRenderStrategy::Canvas => widget::canvas(self)
761 .width(Length::Fill)
762 .height(Length::Fill)
763 .into(),
764 };
765 let plot = plot.map(map_plot);
766
767 let plot_layers = shapes_bottom.chain(std::iter::once(plot)).chain(shapes_top);
768
769 container(stack(plot_layers).width(Length::Fill).height(Length::Fill))
770 .clip(true)
771 .padding(PLOT_CONTENT_PADDING)
772 .style(|theme: &Theme| self.update_style(theme).plot_area)
773 .into()

Callers 1

view_with_shapesMethod · 0.80

Calls 1

positioned_overlayFunction · 0.85

Tested by

no test coverage detected