| 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. |