diff --git a/include/ui/mappixmapitem.h b/include/ui/mappixmapitem.h index b54de69d..554e6f77 100644 --- a/include/ui/mappixmapitem.h +++ b/include/ui/mappixmapitem.h @@ -36,7 +36,6 @@ public: bool right_click; int paint_tile_initial_x; int paint_tile_initial_y; - bool straightPathMode; bool prevStraightPathState; int straight_path_initial_x; int straight_path_initial_y; diff --git a/src/ui/mappixmapitem.cpp b/src/ui/mappixmapitem.cpp index ae0caca0..b45cddac 100644 --- a/src/ui/mappixmapitem.cpp +++ b/src/ui/mappixmapitem.cpp @@ -17,16 +17,12 @@ void MapPixmapItem::paint(QGraphicsSceneMouseEvent *event) { // Set straight paths on/off and snap to the dominant axis when on bool straightPathsEnabled = event->modifiers() & Qt::ControlModifier; if (this->settings->straightPathsEnabled || straightPathsEnabled) { - this->straightPathMode = true; - } else { - this->straightPathMode = false; - this->prevStraightPathState = false; - this->lockedAxis = MapPixmapItem::Axis::None; - } - if (this->straightPathMode) { this->lockNondominantAxis(event); x = this->adjustCoord(x, MapPixmapItem::Axis::X); y = this->adjustCoord(y, MapPixmapItem::Axis::Y); + } else { + this->prevStraightPathState = false; + this->lockedAxis = MapPixmapItem::Axis::None; } // Paint onto the map. @@ -61,14 +57,12 @@ void MapPixmapItem::shift(QGraphicsSceneMouseEvent *event) { // Set straight paths on/off and snap to the dominant axis when on bool straightPathsEnabled = event->modifiers() & Qt::ControlModifier; if (this->settings->straightPathsEnabled || straightPathsEnabled) { - this->straightPathMode = true; - } else { - this->straightPathMode = false; - } - if (this->straightPathMode) { this->lockNondominantAxis(event); x = this->adjustCoord(x, MapPixmapItem::Axis::X); y = this->adjustCoord(y, MapPixmapItem::Axis::Y); + } else { + this->prevStraightPathState = false; + this->lockedAxis = MapPixmapItem::Axis::None; } if (event->type() == QEvent::GraphicsSceneMousePress) {