[nostalgia/core/studio] Fix TileSheetEditor cut to use undo stack
This commit is contained in:
parent
2580dbb7ab
commit
b960539e5f
@ -618,15 +618,16 @@ void SheetData::cutToClipboard() {
|
||||
void SheetData::cutToClipboard(TileSheetClipboard *cb) {
|
||||
const auto start = ptToIdx(cb->point1(), m_columns);
|
||||
const auto end = ptToIdx(cb->point2(), m_columns);
|
||||
TileSheetClipboard apply;
|
||||
for (int i = start; i <= end; ++i) {
|
||||
const auto s = m_pixelSelected[i];
|
||||
if (s) {
|
||||
cb->add(i, m_pixels[i]);
|
||||
m_pixels[i] = 0;
|
||||
apply.add(i, 0);
|
||||
}
|
||||
}
|
||||
emit pixelsChanged();
|
||||
emit changeOccurred();
|
||||
apply.setPoints(cb->point1(), cb->point2());
|
||||
m_cmdStack->push(new PasteClipboardCommand(this, *cb, apply));
|
||||
}
|
||||
|
||||
void SheetData::copyToClipboard() {
|
||||
|
@ -72,8 +72,8 @@ struct TileSheetClipboard {
|
||||
friend ox::Error model(T*, TileSheetClipboard*);
|
||||
|
||||
protected:
|
||||
ox::Vector<PixelChunk> m_chunks;
|
||||
ox::Vector<int> m_pixels;
|
||||
std::vector<PixelChunk> m_chunks;
|
||||
std::vector<int> m_pixels;
|
||||
common::Point m_p1;
|
||||
common::Point m_p2;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user