Temporarily disable smart paths when checked and shift held (closes #294)
This commit is contained in:
parent
50e13ecae3
commit
e597192cc0
2 changed files with 24 additions and 8 deletions
|
@ -1011,11 +1011,19 @@ void Editor::onMapEndPaint(QGraphicsSceneMouseEvent *, MapPixmapItem *item) {
|
||||||
|
|
||||||
void Editor::setSmartPathCursorMode(QGraphicsSceneMouseEvent *event)
|
void Editor::setSmartPathCursorMode(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
bool smartPathsEnabled = event->modifiers() & Qt::ShiftModifier;
|
bool shiftPressed = event->modifiers() & Qt::ShiftModifier;
|
||||||
if (smartPathsEnabled || settings->smartPathsEnabled) {
|
if (settings->smartPathsEnabled) {
|
||||||
this->cursorMapTileRect->setSmartPathMode();
|
if (!shiftPressed) {
|
||||||
|
this->cursorMapTileRect->setSmartPathMode();
|
||||||
|
} else {
|
||||||
|
this->cursorMapTileRect->setNormalPathMode();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this->cursorMapTileRect->setNormalPathMode();
|
if (shiftPressed) {
|
||||||
|
this->cursorMapTileRect->setSmartPathMode();
|
||||||
|
} else {
|
||||||
|
this->cursorMapTileRect->setNormalPathMode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,12 +15,20 @@ void MapPixmapItem::paint(QGraphicsSceneMouseEvent *event) {
|
||||||
int y = static_cast<int>(pos.y()) / 16;
|
int y = static_cast<int>(pos.y()) / 16;
|
||||||
|
|
||||||
// Paint onto the map.
|
// Paint onto the map.
|
||||||
bool smartPathsEnabled = event->modifiers() & Qt::ShiftModifier;
|
bool shiftPressed = event->modifiers() & Qt::ShiftModifier;
|
||||||
QPoint selectionDimensions = this->metatileSelector->getSelectionDimensions();
|
QPoint selectionDimensions = this->metatileSelector->getSelectionDimensions();
|
||||||
if ((this->settings->smartPathsEnabled || smartPathsEnabled) && selectionDimensions.x() == 3 && selectionDimensions.y() == 3) {
|
if (settings->smartPathsEnabled) {
|
||||||
paintSmartPath(x, y);
|
if (!shiftPressed && selectionDimensions.x() == 3 && selectionDimensions.y() == 3) {
|
||||||
|
paintSmartPath(x, y);
|
||||||
|
} else {
|
||||||
|
paintNormal(x, y);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
paintNormal(x, y);
|
if (shiftPressed && selectionDimensions.x() == 3 && selectionDimensions.y() == 3) {
|
||||||
|
paintSmartPath(x, y);
|
||||||
|
} else {
|
||||||
|
paintNormal(x, y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue