[nostalgia/core/studio] Add support for dragging cursor around tile sheet editor

This commit is contained in:
2019-12-05 23:38:51 -06:00
parent 38ae116356
commit 1edd322352
4 changed files with 47 additions and 24 deletions
@@ -61,11 +61,13 @@ class UpdatePixelsCommand: public QUndoCommand {
m_newColorId = newColorId;
cmdIdx = cmdIdx;
for (auto &pi : pixelItems) {
PixelUpdate pu;
auto p = qobject_cast<QQuickItem*>(pi.value<QObject*>());
pu.item = p;
pu.oldColorId = m_palette.indexOf(p->property("color").toString());
m_pixelUpdates.insert(pu);
if (p) {
PixelUpdate pu;
pu.item = p;
pu.oldColorId = m_palette.indexOf(p->property("color").toString());
m_pixelUpdates.insert(pu);
}
}
}