mirror of
https://github.com/huderlem/porymap.git
synced 2026-03-21 17:45:44 -05:00
Fix Move tool affecting cursor anchor
This commit is contained in:
parent
1ab07cf3c7
commit
f42e9ed3cf
|
|
@ -172,7 +172,7 @@ public:
|
|||
void setEditMode(EditMode editMode);
|
||||
EditMode getEditMode() const { return this->editMode; }
|
||||
|
||||
bool getEditingLayout();
|
||||
bool getEditingLayout() const;
|
||||
|
||||
void setMapEditingButtonsEnabled(bool enabled);
|
||||
|
||||
|
|
@ -256,10 +256,11 @@ private:
|
|||
static bool startDetachedProcess(const QString &command,
|
||||
const QString &workingDirectory = QString(),
|
||||
qint64 *pid = nullptr);
|
||||
|
||||
private slots:
|
||||
bool canPaintMetatiles() const;
|
||||
void onMapStartPaint(QGraphicsSceneMouseEvent *event, LayoutPixmapItem *item);
|
||||
void onMapEndPaint(QGraphicsSceneMouseEvent *event, LayoutPixmapItem *item);
|
||||
|
||||
private slots:
|
||||
void setSmartPathCursorMode(QGraphicsSceneMouseEvent *event);
|
||||
void mouseEvent_map(QGraphicsSceneMouseEvent *event, LayoutPixmapItem *item);
|
||||
void mouseEvent_collision(QGraphicsSceneMouseEvent *event, CollisionPixmapItem *item);
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ void Editor::closeProject() {
|
|||
delete this->project;
|
||||
}
|
||||
|
||||
bool Editor::getEditingLayout() {
|
||||
bool Editor::getEditingLayout() const {
|
||||
return this->editMode == EditMode::Metatiles || this->editMode == EditMode::Collision;
|
||||
}
|
||||
|
||||
|
|
@ -1366,8 +1366,12 @@ bool Editor::setLayout(QString layoutId) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Editor::canPaintMetatiles() const {
|
||||
return this->editMode == EditMode::Metatiles && this->mapEditAction != EditAction::Select && this->mapEditAction != EditAction::Move;
|
||||
}
|
||||
|
||||
void Editor::onMapStartPaint(QGraphicsSceneMouseEvent *event, LayoutPixmapItem *) {
|
||||
if (!this->getEditingLayout()) {
|
||||
if (!canPaintMetatiles()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1380,7 +1384,7 @@ void Editor::onMapStartPaint(QGraphicsSceneMouseEvent *event, LayoutPixmapItem *
|
|||
}
|
||||
|
||||
void Editor::onMapEndPaint(QGraphicsSceneMouseEvent *, LayoutPixmapItem *) {
|
||||
if (!this->getEditingLayout()) {
|
||||
if (!canPaintMetatiles()) {
|
||||
return;
|
||||
}
|
||||
this->cursorMapTileRect->stopRightClickSelectionAnchor();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user