mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-03 21:46:20 +00:00
Fix regression: bug copying & pasting regular cels in the timeline
Before this fix if an image were allocated in the clipboard, then you copied a Cel and wanted to paste it to other Cel, the previous image were pasted in the canvas instead the last Cel copied in the timeline. How to reproduce the bug: - Make a sprite. - Draw something on the canvas. - Select a drawn region and copy the selection (the image is now in the clipboard). - Add a frame in the time line. - Copy the Cel of frame 1. - Select the empty Cel of the frame 2. - Paste: you'll see the image selected in step 3 was pasted on the canvas instead the last Cel copied on the timeline.
This commit is contained in:
parent
80322af02e
commit
684ae08112
@ -341,6 +341,8 @@ void Clipboard::clearMaskFromCels(Tx& tx,
|
||||
|
||||
void Clipboard::clearContent()
|
||||
{
|
||||
if (use_native_clipboard())
|
||||
clearNativeContent();
|
||||
m_data->clear();
|
||||
}
|
||||
|
||||
|
@ -96,6 +96,7 @@ namespace app {
|
||||
bool copyFromDocument(const Site& site, bool merged = false);
|
||||
|
||||
// Native clipboard
|
||||
void clearNativeContent();
|
||||
void registerNativeFormats();
|
||||
bool hasNativeBitmap() const;
|
||||
bool setNativeBitmap(const doc::Image* image,
|
||||
|
@ -54,6 +54,12 @@ namespace {
|
||||
|
||||
}
|
||||
|
||||
void Clipboard::clearNativeContent()
|
||||
{
|
||||
clip::lock l(native_window_handle());
|
||||
l.clear();
|
||||
}
|
||||
|
||||
void Clipboard::registerNativeFormats()
|
||||
{
|
||||
clip::set_error_handler(custom_error_handler);
|
||||
|
Loading…
Reference in New Issue
Block a user