mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-06 06:50:07 +00:00
This commit is contained in:
parent
04e095bbd5
commit
d8c1b19c80
@ -466,6 +466,7 @@ void Clipboard::paste(Context* ctx,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
auto editor = Editor::activeEditor();
|
auto editor = Editor::activeEditor();
|
||||||
|
bool updateDstDoc = false;
|
||||||
|
|
||||||
switch (format()) {
|
switch (format()) {
|
||||||
|
|
||||||
@ -587,11 +588,11 @@ void Clipboard::paste(Context* ctx,
|
|||||||
// cels in the same document.
|
// cels in the same document.
|
||||||
if (srcDoc == dstDoc) {
|
if (srcDoc == dstDoc) {
|
||||||
// This is the app::copy_range (not clipboard::copy_range()).
|
// This is the app::copy_range (not clipboard::copy_range()).
|
||||||
if (srcRange.layers() == dstRange.layers())
|
if (srcRange.layers() == dstRange.layers()) {
|
||||||
app::copy_range(srcDoc, srcRange, dstRange, kDocRangeBefore);
|
app::copy_range(srcDoc, srcRange, dstRange, kDocRangeBefore);
|
||||||
if (editor)
|
updateDstDoc = true;
|
||||||
editor->invalidate(); // TODO check if this is necessary
|
}
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Tx tx(ctx, "Paste Cels");
|
Tx tx(ctx, "Paste Cels");
|
||||||
@ -636,8 +637,7 @@ void Clipboard::paste(Context* ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
tx.commit();
|
tx.commit();
|
||||||
if (editor)
|
updateDstDoc = true;
|
||||||
editor->invalidate(); // TODO check if this is necessary
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -651,6 +651,7 @@ void Clipboard::paste(Context* ctx,
|
|||||||
dstRange.startRange(nullptr, dstFrame, DocRange::kFrames);
|
dstRange.startRange(nullptr, dstFrame, DocRange::kFrames);
|
||||||
dstRange.endRange(nullptr, dstFrame);
|
dstRange.endRange(nullptr, dstFrame);
|
||||||
app::copy_range(srcDoc, srcRange, dstRange, kDocRangeBefore);
|
app::copy_range(srcDoc, srcRange, dstRange, kDocRangeBefore);
|
||||||
|
updateDstDoc = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -689,8 +690,7 @@ void Clipboard::paste(Context* ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
tx.commit();
|
tx.commit();
|
||||||
if (editor)
|
updateDstDoc = true;
|
||||||
editor->invalidate(); // TODO check if this is necessary
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -741,8 +741,7 @@ void Clipboard::paste(Context* ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
tx.commit();
|
tx.commit();
|
||||||
if (editor)
|
updateDstDoc = true;
|
||||||
editor->invalidate(); // TODO check if this is necessary
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -750,6 +749,10 @@ void Clipboard::paste(Context* ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update all editors/views showing this document
|
||||||
|
if (updateDstDoc)
|
||||||
|
dstDoc->notifyGeneralUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageRef Clipboard::getImage(Palette* palette)
|
ImageRef Clipboard::getImage(Palette* palette)
|
||||||
|
Loading…
Reference in New Issue
Block a user