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

Method bind_arrow_pan

src/controls.rs:313–342  ·  view source on GitHub ↗

Bind the four arrow keys to pan by the given fraction of the visible span.

(&mut self, fraction: f64)

Source from the content-addressed store, hash-verified

311
312 /// Bind the four arrow keys to pan by the given fraction of the visible span.
313 pub fn bind_arrow_pan(&mut self, fraction: f64) -> &mut Self {
314 self.bind_key(
315 keyboard::Key::Named(keyboard::key::Named::ArrowLeft),
316 KeyAction::PanBy {
317 direction: PanDirection::Left,
318 fraction,
319 },
320 )
321 .bind_key(
322 keyboard::Key::Named(keyboard::key::Named::ArrowRight),
323 KeyAction::PanBy {
324 direction: PanDirection::Right,
325 fraction,
326 },
327 )
328 .bind_key(
329 keyboard::Key::Named(keyboard::key::Named::ArrowUp),
330 KeyAction::PanBy {
331 direction: PanDirection::Up,
332 fraction,
333 },
334 )
335 .bind_key(
336 keyboard::Key::Named(keyboard::key::Named::ArrowDown),
337 KeyAction::PanBy {
338 direction: PanDirection::Down,
339 fraction,
340 },
341 )
342 }
343
344 /// Remove all arrow-key pan bindings.
345 pub fn unbind_arrow_pan(&mut self) -> &mut Self {

Callers 2

defaultMethod · 0.80
updateMethod · 0.80

Calls 1

bind_keyMethod · 0.80

Tested by

no test coverage detected