aboutsummaryrefslogtreecommitdiff
path: root/mapman/src/painter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mapman/src/painter.cpp')
-rw-r--r--mapman/src/painter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/mapman/src/painter.cpp b/mapman/src/painter.cpp
index 876184e..5b3ad3b 100644
--- a/mapman/src/painter.cpp
+++ b/mapman/src/painter.cpp
@@ -72,6 +72,8 @@ void map_painter::set_dimension(int h, int v)
s->clear();
slices.clear();
slices.resize(hc * vc, nullptr);
+ bgspr.clear();
+ bgspr.resize(hc * vc, {nullptr, nullptr});
for (int i = 0; i < vc; ++i)
for (int j = 0; j < hc; ++j)
{
@@ -79,6 +81,7 @@ void map_painter::set_dimension(int h, int v)
t->setPos(j * 128 + 64 - t->boundingRect().width() / 2, i * 128 + 64 - t->boundingRect().height() / 2);
auto r = new drop_rect(i * hc + j, this);
s->addItem(r);
+ bgspr[i * hc + j] = {t, r};
r->setPos(j * 128, i * 128);
}
}
@@ -92,6 +95,7 @@ void map_painter::set_map_id(int pos, bool populated, int id, bool user_input)
delete slices[pos];
slices[pos] = nullptr;
}
+ auto [t, r] = bgspr[pos];
if (populated)
{
QPixmap pm;
@@ -105,6 +109,8 @@ void map_painter::set_map_id(int pos, bool populated, int id, bool user_input)
int y = pos % hc;
p->setPos(y * 128, x * 128);
slices[pos] = p;
+ static_cast<QAbstractGraphicsShapeItem*>(t)->setPen(QColor(Qt::GlobalColor::transparent));
+ static_cast<QAbstractGraphicsShapeItem*>(r)->setPen(QColor(Qt::GlobalColor::transparent));
}
if (user_input)
emit map_id_changed(pos, populated, id);