From 15dd197ff142147f63e08d614340558b21641dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Sun, 22 Mar 2020 12:16:48 +0100 Subject: [PATCH] tiledquickplugin: Apply tileset drawing offset See #2772 --- src/tiledquickplugin/tilelayeritem.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tiledquickplugin/tilelayeritem.cpp b/src/tiledquickplugin/tilelayeritem.cpp index e4cd0cfe38..7c625b7097 100644 --- a/src/tiledquickplugin/tilelayeritem.cpp +++ b/src/tiledquickplugin/tilelayeritem.cpp @@ -177,9 +177,11 @@ QSGNode *TileLayerItem::updatePaintNode(QSGNode *node, // return; // } + const auto offset = tileset->tileOffset(); + TileData data; - data.x = static_cast(pos.x()); - data.y = static_cast(pos.y() - size.height()); + data.x = static_cast(pos.x()) + offset.x(); + data.y = static_cast(pos.y() - size.height()) + offset.y(); data.width = static_cast(size.width()); data.height = static_cast(size.height()); data.flippedHorizontally = cell.flippedHorizontally();