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

Function configured_key_autoscales_when_hovered

src/plot_state.rs:1882–1913  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1880 Event::ButtonReleased(mouse::Button::Left),
1881 mouse::Cursor::Available(Point::new(50.0, 50.0)),
1882 &widget,
1883 &mut hover_pick,
1884 &mut drag_event,
1885 );
1886
1887 assert!(matches!(hover_pick, Some(HoverPickEvent::Pick(id)) if id == point_id));
1888 assert!(!state.selection.active);
1889 }
1890
1891 #[test]
1892 fn left_double_click_autoscales_when_left_button_is_box_zoom() {
1893 let mut widget = PlotWidget::new();
1894 widget
1895 .controls
1896 .set_drag_action(DragAction::Pan, Some(mouse::Button::Right))
1897 .set_drag_action(DragAction::BoxZoom, Some(mouse::Button::Left));
1898
1899 let mut state = PlotState {
1900 bounds: Rectangle {
1901 x: 0.0,
1902 y: 0.0,
1903 width: 100.0,
1904 height: 100.0,
1905 },
1906 cursor_position: Vec2::new(50.0, 50.0),
1907 data_min: Some(DVec2::new(10.0, 20.0)),
1908 data_max: Some(DVec2::new(30.0, 60.0)),
1909 ..PlotState::default()
1910 };
1911 state.camera.position = DVec2::ZERO;
1912
1913 let mut hover_pick = None;
1914 let mut drag_event = None;
1915 for _ in 0..2 {
1916 state.handle_mouse_event(

Callers

nothing calls this directly

Calls 4

key_eventFunction · 0.85
bind_keyMethod · 0.80
handle_keyboard_eventMethod · 0.80
newFunction · 0.50

Tested by

no test coverage detected