1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-09-29 07:29:00 +00:00

Merge pull request #659 from matthew16550/macos-copy

Fix copy to clipboard on Mac
This commit is contained in:
arnaudroques 2021-09-08 10:43:24 +02:00 committed by GitHub
commit 3c286fdbaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -388,10 +388,14 @@ class ImageWindow extends JFrame {
if (generatedImage == null) {
return;
}
final File png = generatedImage.getPngFile();
final Image image = Toolkit.getDefaultToolkit().createImage(png.getAbsolutePath());
final ImageSelection imgSel = new ImageSelection(image);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(imgSel, null);
try {
final File png = generatedImage.getPngFile();
final Image image = ImageIO.read(png);
final ImageSelection imgSel = new ImageSelection(image);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(imgSel, null);
} catch (IOException e) {
e.printStackTrace();
}
}
public SimpleLine getSimpleLine() {