mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[apps/shared] Change zoom to ensure to keep the same cusor position
Change-Id: Ie24fcdda2aad7da8872915511fcd2e71d19ff8a6
This commit is contained in:
@@ -21,12 +21,16 @@ View * ZoomParameterController::view() {
|
||||
|
||||
bool ZoomParameterController::handleEvent(Ion::Events::Event event) {
|
||||
if (event == Ion::Events::Plus) {
|
||||
m_interactiveRange->zoom(1.0f/3.0f);
|
||||
float meanX = (m_interactiveRange->xMin()+m_interactiveRange->xMax())/2.0f;
|
||||
float meanY = (m_interactiveRange->yMin()+m_interactiveRange->yMax())/2.0f;
|
||||
m_interactiveRange->zoom(2.0f/3.0f, meanX, meanY);
|
||||
m_contentView.curveView()->reload();
|
||||
return true;
|
||||
}
|
||||
if (event == Ion::Events::Minus) {
|
||||
m_interactiveRange->zoom(3.0f/4.0f);
|
||||
float meanX = (m_interactiveRange->xMin()+m_interactiveRange->xMax())/2.0f;
|
||||
float meanY = (m_interactiveRange->yMin()+m_interactiveRange->yMax())/2.0f;
|
||||
m_interactiveRange->zoom(3.0f/2.0f, meanX, meanY);
|
||||
m_contentView.curveView()->reload();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user