From e2dd4fb76bac22a08ea6d528178c3f74b8b74f1b Mon Sep 17 00:00:00 2001 From: BigBahss Date: Fri, 2 Oct 2020 14:06:58 -0400 Subject: [PATCH] Disable MapRuler when switching tool buttons --- src/editor.cpp | 4 ++-- src/mainwindow.cpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/editor.cpp b/src/editor.cpp index 368dd753..172f0f6c 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -1967,8 +1967,8 @@ void Editor::objectsView_onMousePress(QMouseEvent *event) { if (map_item && map_item->paintingMode != MapPixmapItem::PaintMode::EventObjects) { return; } - if (this->map_edit_mode == "paint" && event->buttons() & Qt::RightButton) { - this->map_edit_mode = "select"; + if (this->obj_edit_mode == "paint" && event->buttons() & Qt::RightButton) { + this->obj_edit_mode = "select"; this->settings->mapCursor = QCursor(); this->cursorMapTileRect->setSingleTileMode(); this->ui->toolButton_Paint->setChecked(false); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e44753f7..e33e561d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2241,6 +2241,9 @@ void MainWindow::checkToolButtons() { else edit_mode = editor->obj_edit_mode; + if (edit_mode != "select" && editor->map_ruler) + editor->map_ruler->endAnchor(); + ui->toolButton_Paint->setChecked(edit_mode == "paint"); ui->toolButton_Select->setChecked(edit_mode == "select"); ui->toolButton_Fill->setChecked(edit_mode == "fill");