| 154 | |
| 155 | |
| 156 | void RackScrollWidget::onHoverScroll(const HoverScrollEvent& e) { |
| 157 | int mods = APP->window->getMods(); |
| 158 | bool doZoom = mods & RACK_MOD_CTRL; |
| 159 | if (settings::mouseWheelZoom) |
| 160 | doZoom ^= true; |
| 161 | |
| 162 | if (doZoom) { |
| 163 | // Dispatch to children first and zoom only if they don't consume |
| 164 | OpaqueWidget::onHoverScroll(e); |
| 165 | if (e.isConsumed()) |
| 166 | return; |
| 167 | // Increase zoom |
| 168 | float zoomDelta = e.scrollDelta.y / 50 / 4; |
| 169 | if (settings::invertZoom) |
| 170 | zoomDelta *= -1; |
| 171 | float zoom = getZoom() * std::pow(2.f, zoomDelta); |
| 172 | setZoom(zoom, e.pos); |
| 173 | e.consume(this); |
| 174 | return; |
| 175 | } |
| 176 | |
| 177 | ScrollWidget::onHoverScroll(e); |
| 178 | } |
| 179 | |
| 180 | |
| 181 | void RackScrollWidget::onHover(const HoverEvent& e) { |
nothing calls this directly
no test coverage detected