From 536435c057d9e0af708abb556b39545ab5bfa6cc Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 6 Dec 2019 23:28:18 -0600 Subject: [PATCH] [nostalgia/core/studio] Fix undo operation in TileSheetEditor --- src/nostalgia/core/studio/tilesheeteditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nostalgia/core/studio/tilesheeteditor.cpp b/src/nostalgia/core/studio/tilesheeteditor.cpp index 30edb336..30cb413b 100644 --- a/src/nostalgia/core/studio/tilesheeteditor.cpp +++ b/src/nostalgia/core/studio/tilesheeteditor.cpp @@ -61,7 +61,7 @@ class UpdatePixelsCommand: public QUndoCommand { m_cmdIdx = cmdIdx; PixelUpdate pu; pu.item = pixelItem; - pu.oldColorId = m_palette.indexOf(pixelItem->property("color").toString()); + pu.oldColorId = m_palette.indexOf(pixelItem->property("color").value().name(QColor::HexArgb)); m_pixelUpdates.insert(pu); } @@ -89,7 +89,7 @@ class UpdatePixelsCommand: public QUndoCommand { void undo() override { for (const auto &pu : m_pixelUpdates) { - pu.item->setProperty("color", pu.oldColorId); + pu.item->setProperty("color", m_palette[pu.oldColorId]); m_pixels[pu.item->property("pixelNumber").toInt()] = pu.oldColorId; } }