Mercurial > hg > sonic-visualiser
comparison main/OSCHandler.cpp @ 2031:4db75d584e5a
Merge from branch zoom
author | Chris Cannam |
---|---|
date | Wed, 10 Oct 2018 08:58:20 +0100 |
parents | b184e71f880d |
children | 0b15f3b16776 |
comparison
equal
deleted
inserted
replaced
2029:d70122abd746 | 2031:4db75d584e5a |
---|---|
495 message.getArg(0).toString() == "fit") { | 495 message.getArg(0).toString() == "fit") { |
496 zoomToFit(); | 496 zoomToFit(); |
497 } else if (message.getArg(0).canConvert(QVariant::Double)) { | 497 } else if (message.getArg(0).canConvert(QVariant::Double)) { |
498 double level = message.getArg(0).toDouble(); | 498 double level = message.getArg(0).toDouble(); |
499 Pane *currentPane = m_paneStack->getCurrentPane(); | 499 Pane *currentPane = m_paneStack->getCurrentPane(); |
500 if (level < 1.0) level = 1.0; | 500 ZoomLevel zoomLevel; |
501 if (currentPane) currentPane->setZoomLevel(int(lrint(level))); | 501 if (level >= 0.66) { |
502 zoomLevel = ZoomLevel(ZoomLevel::FramesPerPixel, | |
503 int(round(level))); | |
504 } else { | |
505 zoomLevel = ZoomLevel(ZoomLevel::PixelsPerFrame, | |
506 int(round(1.0 / level))); | |
507 } | |
508 if (currentPane) { | |
509 currentPane->setZoomLevel(zoomLevel); | |
510 } | |
502 } | 511 } |
503 } | 512 } |
504 | 513 |
505 } else if (message.getMethod() == "zoomvertical") { | 514 } else if (message.getMethod() == "zoomvertical") { |
506 | 515 |