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

Method default

src/controls.rs:104–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102
103impl Default for PlotControls {
104 fn default() -> Self {
105 let mut controls = Self {
106 drag: HashMap::new(),
107 scroll: HashMap::new(),
108 click: HashMap::new(),
109 double_click: HashMap::new(),
110 key: HashMap::new(),
111 drag_delta_threshold: 4.0,
112 selection_padding: 0.02,
113 };
114
115 controls
116 .bind_drag(mouse::Button::Left, DragAction::Pan)
117 .bind_drag(mouse::Button::Right, DragAction::BoxZoom)
118 .bind_scroll(keyboard::Modifiers::NONE, ScrollAction::Pan)
119 .bind_scroll(keyboard::Modifiers::CTRL, ScrollAction::Zoom)
120 .bind_click(mouse::Button::Left, ClickAction::Pick)
121 .bind_double_click(mouse::Button::Left, ClickAction::Autoscale)
122 .bind_key(
123 keyboard::Key::Named(keyboard::key::Named::Escape),
124 KeyAction::ClearPick,
125 );
126
127 controls.bind_arrow_pan(0.1);
128 controls
129 }
130}
131
132impl PlotControls {

Callers

nothing calls this directly

Calls 7

bind_keyMethod · 0.80
bind_double_clickMethod · 0.80
bind_clickMethod · 0.80
bind_scrollMethod · 0.80
bind_dragMethod · 0.80
bind_arrow_panMethod · 0.80
newFunction · 0.50

Tested by

no test coverage detected