Skip to content

Commit

Permalink
tiledquickplugin: Apply tileset drawing offset
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn committed Mar 22, 2020
1 parent 079ab20 commit 15dd197
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tiledquickplugin/tilelayeritem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ QSGNode *TileLayerItem::updatePaintNode(QSGNode *node,
// return;
// }

const auto offset = tileset->tileOffset();

TileData data;
data.x = static_cast<float>(pos.x());
data.y = static_cast<float>(pos.y() - size.height());
data.x = static_cast<float>(pos.x()) + offset.x();
data.y = static_cast<float>(pos.y() - size.height()) + offset.y();
data.width = static_cast<float>(size.width());
data.height = static_cast<float>(size.height());
data.flippedHorizontally = cell.flippedHorizontally();
Expand Down

0 comments on commit 15dd197

Please sign in to comment.