Browse Source

Add Ctrl-0 key command for resetting zoom.

tags/v1.1.0
Andrew Belt 5 years ago
parent
commit
71c28eb84c
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      src/app/Scene.cpp

+ 8
- 2
src/app/Scene.cpp View File

@@ -108,7 +108,7 @@ void Scene::onHoverKey(const event::HoverKey &e) {
if ((e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
float zoom = settings::zoom;
zoom *= 2;
zoom = std::ceil(zoom - 0.01) - 1;
zoom = std::ceil(zoom - 0.01f) - 1;
zoom /= 2;
settings::zoom = zoom;
e.consume(this);
@@ -118,12 +118,18 @@ void Scene::onHoverKey(const event::HoverKey &e) {
if ((e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
float zoom = settings::zoom;
zoom *= 2;
zoom = std::floor(zoom + 0.01) + 1;
zoom = std::floor(zoom + 0.01f) + 1;
zoom /= 2;
settings::zoom = zoom;
e.consume(this);
}
} break;
case GLFW_KEY_0: {
if ((e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
settings::zoom = 0.f;
e.consume(this);
}
} break;
case GLFW_KEY_ENTER: {
if ((e.mods & RACK_MOD_MASK) == 0) {
moduleBrowser->show();


Loading…
Cancel
Save