From 541185df8c08617d840a28adf422626a16308b6e Mon Sep 17 00:00:00 2001 From: Person Date: Fri, 31 Jan 2020 16:21:23 -0800 Subject: [PATCH] --Bug fixes -Fix more bugs with keyboard shortcuts. --- Source/Fractorium/Fractorium.cpp | 62 +++++++++++++++++---------- Source/Fractorium/FractoriumMenus.cpp | 1 + 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/Source/Fractorium/Fractorium.cpp b/Source/Fractorium/Fractorium.cpp index 449cb73..42ec445 100644 --- a/Source/Fractorium/Fractorium.cpp +++ b/Source/Fractorium/Fractorium.cpp @@ -491,38 +491,56 @@ bool Fractorium::eventFilter(QObject* o, QEvent* e) } else if (ke->key() == Qt::Key_P) { - pcount++; - - if (pcount >= times) + if (!ctrl) { - pcount = 0; + pcount++; - if (!shift) - ui.ActionDrawPreAffines->setChecked(!ui.ActionDrawPreAffines->isChecked()); - else - ui.ActionDrawPostAffines->setChecked(!ui.ActionDrawPostAffines->isChecked()); + if (pcount >= times) + { + pcount = 0; + + if (!shift) + { + ui.ActionDrawPreAffines->setChecked(!ui.ActionDrawPreAffines->isChecked()); + OnActionDrawAffines(ui.ActionDrawPreAffines->isChecked()); + } + else + { + ui.ActionDrawPostAffines->setChecked(!ui.ActionDrawPostAffines->isChecked()); + OnActionDrawAffines(ui.ActionDrawPostAffines->isChecked()); + } + } + + return true; } - - return true; } else if (ke->key() == Qt::Key_L) { - lcount++; - - if (lcount >= times) + if (!ctrl) { - lcount = 0; + lcount++; - if (!shift) + if (lcount >= times) { - if (DrawPreAffines()) - ui.ActionDrawAllPreAffines->setChecked(!ui.ActionDrawAllPreAffines->isChecked()); - } - else if (DrawPostAffines()) - ui.ActionDrawAllPostAffines->setChecked(!ui.ActionDrawAllPostAffines->isChecked()); - } + lcount = 0; - return true; + if (!shift) + { + if (DrawPreAffines()) + { + ui.ActionDrawAllPreAffines->setChecked(!ui.ActionDrawAllPreAffines->isChecked()); + OnActionDrawAllAffines(ui.ActionDrawAllPreAffines->isChecked()); + } + } + else if (DrawPostAffines()) + { + ui.ActionDrawAllPostAffines->setChecked(!ui.ActionDrawAllPostAffines->isChecked()); + OnActionDrawAllAffines(ui.ActionDrawAllPostAffines->isChecked()); + } + } + + return true; + } } else if ((!DrawPreAffines() && pre) || (!DrawPostAffines() && !pre))//Everything below this must be for editing xforms via key press. { diff --git a/Source/Fractorium/FractoriumMenus.cpp b/Source/Fractorium/FractoriumMenus.cpp index c5bb28e..2819425 100644 --- a/Source/Fractorium/FractoriumMenus.cpp +++ b/Source/Fractorium/FractoriumMenus.cpp @@ -768,6 +768,7 @@ void Fractorium::OnActionAlternateEditorImage(bool checked) { if (DrawPreAffines() || DrawPostAffines()) { + SaveAffineState(); ui.ActionDrawPreAffines->setChecked(false); ui.ActionDrawAllPreAffines->setChecked(false); ui.ActionDrawPostAffines->setChecked(false);