| 79 | |
| 80 | |
| 81 | void RackScrollWidget::zoomToBound(math::Rect bound) { |
| 82 | if (!bound.pos.isFinite()) |
| 83 | return; |
| 84 | bound = bound.grow(math::Vec(24, 24)); |
| 85 | math::Vec size = getSize(); |
| 86 | float zoom = std::min(size.x / bound.size.x, size.y / bound.size.y); |
| 87 | offset = bound.getCenter() * zoom - size / 2; |
| 88 | zoomWidget->setZoom(zoom); |
| 89 | } |
| 90 | |
| 91 | |
| 92 | void RackScrollWidget::step() { |