Skip to content

Commit 0da6ae9

Browse files
Fix dragging events to negative coordinates
1 parent 37ccc82 commit 0da6ae9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/core/metatile.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ int Metatile::getIndexInTileset(int metatileId) {
3838
QPoint Metatile::coordFromPixmapCoord(const QPointF &pixelCoord) {
3939
int x = static_cast<int>(pixelCoord.x()) / 16;
4040
int y = static_cast<int>(pixelCoord.y()) / 16;
41+
if (pixelCoord.x() < 0) x--;
42+
if (pixelCoord.y() < 0) y--;
4143
return QPoint(x, y);
4244
}
4345

0 commit comments

Comments
 (0)