MCPcopy Create free account
hub / github.com/emilk/egui_plot / allocate_axis_responses

Method allocate_axis_responses

egui_plot/src/plot.rs:855–881  ·  view source on GitHub ↗
(&self, ui: &mut Ui, axis_widgets: &AxisWidgets<'_>)

Source from the content-addressed store, hash-verified

853 }
854
855 fn allocate_axis_responses(&self, ui: &mut Ui, axis_widgets: &AxisWidgets<'_>) -> AxisResponses {
856 let x_axis_responses = axis_widgets[0]
857 .iter()
858 .map(|widget| {
859 let axis_response = ui.allocate_rect(widget.rect, Sense::drag());
860 if self.allow_axis_zoom_drag.x {
861 axis_response.on_hover_cursor(CursorIcon::ResizeHorizontal)
862 } else {
863 axis_response
864 }
865 })
866 .collect::<Vec<_>>();
867
868 let y_axis_responses = axis_widgets[1]
869 .iter()
870 .map(|widget| {
871 let axis_response = ui.allocate_rect(widget.rect, Sense::drag());
872 if self.allow_axis_zoom_drag.y {
873 axis_response.on_hover_cursor(CursorIcon::ResizeVertical)
874 } else {
875 axis_response
876 }
877 })
878 .collect::<Vec<_>>();
879
880 [x_axis_responses, y_axis_responses]
881 }
882
883 fn load_or_init_memory(&self, ui: &Ui, plot_id: Id, plot_rect: Rect) -> PlotMemory {
884 // Load or initialize the memory.

Callers 1

show_dynMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected