Skip to content

Commit

Permalink
other tools zoom on plus and equals. hence, we go back to doing so, too
Browse files Browse the repository at this point in the history
  • Loading branch information
bertiqwerty committed Jan 8, 2024
1 parent 3410a1b commit d4df42d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn map_key(egui_key: egui::Key) -> Option<rvlib::KeyCode> {
egui::Key::Num7 => Some(rvlib::KeyCode::Key7),
egui::Key::Num8 => Some(rvlib::KeyCode::Key8),
egui::Key::Num9 => Some(rvlib::KeyCode::Key9),
egui::Key::Plus => Some(rvlib::KeyCode::Plus),
egui::Key::Plus | egui::Key::Equals => Some(rvlib::KeyCode::PlusEquals),
egui::Key::Minus => Some(rvlib::KeyCode::Minus),
egui::Key::Delete => Some(rvlib::KeyCode::Delete),
egui::Key::Backspace => Some(rvlib::KeyCode::Back),
Expand Down
2 changes: 1 addition & 1 deletion src/rvlib/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub enum KeyCode {
Key7,
Key8,
Key9,
Plus,
PlusEquals,
Minus,
Delete,
Back,
Expand Down
4 changes: 2 additions & 2 deletions src/rvlib/tools/always_active_zoom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl AlwaysActiveZoom {
if events.held_ctrl() {
let zb = if events.released(KeyCode::Key0) {
None
} else if events.released(KeyCode::Plus) {
} else if events.released(KeyCode::PlusEquals) {
zoom_box_mouse_wheel(*world.zoom_box(), world.shape_orig(), 1.0)
} else if events.released(KeyCode::Minus) {
zoom_box_mouse_wheel(*world.zoom_box(), world.shape_orig(), -1.0)
Expand Down Expand Up @@ -79,7 +79,7 @@ impl Manipulate for AlwaysActiveZoom {
(pressed, KeyCode::MouseLeft, mouse_pressed),
(held, KeyCode::MouseLeft, mouse_held),
(released, KeyCode::Key0, key_released),
(released, KeyCode::Plus, key_released), // Plus is equals
(released, KeyCode::PlusEquals, key_released), // Plus is equals
(released, KeyCode::Minus, key_released)
]
)
Expand Down

0 comments on commit d4df42d

Please # to comment.