Rename DraggablePixmapItem::move() overload as moveTo to avoid confusion
This commit is contained in:
parent
5f292ea3cc
commit
a9c7691a2e
3 changed files with 13 additions and 6 deletions
|
@ -33,8 +33,8 @@ public:
|
|||
int last_y;
|
||||
|
||||
void updatePosition();
|
||||
void move(int x, int y);
|
||||
void move(const QPoint &pos) { move(pos.x(), pos.y()); }
|
||||
void move(int dx, int dy);
|
||||
void moveTo(const QPoint &pos);
|
||||
void emitPositionChanged();
|
||||
void updatePixmap();
|
||||
void bind(QComboBox *combo, QString key);
|
||||
|
|
|
@ -1553,7 +1553,7 @@ void MainWindow::addNewEvent(QString event_type)
|
|||
if (object) {
|
||||
auto halfSize = ui->graphicsView_Map->size() / 2;
|
||||
auto centerPos = ui->graphicsView_Map->mapToScene(halfSize.width(), halfSize.height());
|
||||
object->move(Metatile::coordFromPixmapCoord(centerPos));
|
||||
object->moveTo(Metatile::coordFromPixmapCoord(centerPos));
|
||||
updateObjects();
|
||||
editor->selectMapEvent(object, false);
|
||||
} else {
|
||||
|
|
|
@ -65,9 +65,16 @@ void DraggablePixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *mouse) {
|
|||
this->editor->selectingEvent = true;
|
||||
}
|
||||
|
||||
void DraggablePixmapItem::move(int x, int y) {
|
||||
event->setX(event->x() + x);
|
||||
event->setY(event->y() + y);
|
||||
void DraggablePixmapItem::move(int dx, int dy) {
|
||||
event->setX(event->x() + dx);
|
||||
event->setY(event->y() + dy);
|
||||
updatePosition();
|
||||
emitPositionChanged();
|
||||
}
|
||||
|
||||
void DraggablePixmapItem::moveTo(const QPoint &pos) {
|
||||
event->setX(pos.x());
|
||||
event->setY(pos.y());
|
||||
updatePosition();
|
||||
emitPositionChanged();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue