Skip to content

Commit

Permalink
Fix PNG clipboard copy some more
Browse files Browse the repository at this point in the history
  • Loading branch information
aardappel committed Dec 8, 2022
1 parent 39e51b8 commit 755494e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -1553,11 +1553,20 @@ struct Document {
if (selected.Thin()) return NoThin();

if (wxTheClipboard->Open()) {
#if defined(__WXMSW__) || defined(__WXGTK__)
if (!c->text.image->png_data.empty()) {
wxCustomDataObject *pngimage = new wxCustomDataObject(wxDF_PNG);
wxCustomDataObject *pngimage = new wxCustomDataObject(
#ifdef __WXMSW__
wxDF_PNG
#else
wxDF_BITMAP
#endif
);
pngimage->SetData(c->text.image->png_data.size(), c->text.image->png_data.data());
wxTheClipboard->SetData(pngimage);
} else {
} else
#endif
{
wxTheClipboard->SetData(new wxBitmapDataObject(c->text.image->bm_orig));
}
wxTheClipboard->Close();
Expand Down

0 comments on commit 755494e

Please sign in to comment.