Merged in mmastriani/fractorium_michel (pull request #26)

Fixed Grid and Solution for sensitive mouse
This commit is contained in:
Michel Mastriani 2019-06-12 02:15:53 +00:00 committed by Matt Feemster
commit 29407d5949
2 changed files with 11 additions and 8 deletions

View File

@ -261,6 +261,7 @@ void FractoriumEmberController<T>::OpenAndPrepFiles(const QStringList& filenames
FillLibraryTree(append ? previousSize - 1 : 0);
ClearUndo();
m_GLController->ClearControl();
SetEmber(previousSize, false);
}
}
@ -321,6 +322,8 @@ void FractoriumEmberController<T>::SaveCurrentAsXml()
else
m_Fractorium->ShowCritical("Save Failed", "Could not save file, try saving to a different folder.");
}
m_GLController->ClearControl();
}
void Fractorium::OnActionSaveCurrentAsXml(bool checked) { m_Controller->SaveCurrentAsXml(); }
@ -364,6 +367,8 @@ void FractoriumEmberController<T>::SaveEntireFileAsXml()
else
m_Fractorium->ShowCritical("Save Failed", "Could not save file, try saving to a different folder.");
}
m_GLController->ClearControl();
}
void Fractorium::OnActionSaveEntireFileAsXml(bool checked) { m_Controller->SaveEntireFileAsXml(); }

View File

@ -1116,11 +1116,9 @@ void GLEmberController<T>::Wheel(QWheelEvent* e)
}
else
{
if (m_Fractorium->DrawImage())
if (m_Fractorium->DrawImage() && (!(e->buttons() & Qt::MiddleButton)) && (!(e->modifiers() & Qt::ShiftModifier))) //Middle button does whole image translation, so ignore the mouse wheel while panning to avoid inadvertent zooming. ShiftModifier for sensitive mouse.
{
auto ember = m_FractoriumEmberController->CurrentEmber();
if (!(e->buttons() & Qt::MiddleButton))//Middle button does whole image translation, so ignore the mouse wheel while panning to avoid inadvertent zooming.
m_Fractorium->SetScale(ember->m_PixelsPerUnit + (e->angleDelta().y() >= 0 ? 50 : -50));
}
}