(
&'a self,
shape: plot_overlay::PlotOverlay<'a, Message>,
)
| 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() |
no test coverage detected