From 6a23157c634f7a4284a4f57afa5d9bcf833b5927 Mon Sep 17 00:00:00 2001 From: David Gilbert Date: Tue, 10 Nov 2020 21:11:18 +0100 Subject: [PATCH] Remove alpha channel from copy-to-clipboard - fix for #182 --- README.md | 21 ++++++++++--------- .../org/jfree/chart/ChartTransferable.java | 8 +++---- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 9ac906f9de..79421894e1 100644 --- a/README.md +++ b/README.md @@ -73,19 +73,20 @@ History ------- ##### Version 1.6.0 (not yet released) -- update required JDK to version 1.8; -- modify buffer in ChartPanel to handle high DPI displays (bug #170); +- modify buffer in `ChartPanel` to handle high DPI displays (bug #170); - add options to control pan vs zoom in `ChartPanel` (https://github.com/jfree/jfreechart/pull/172) -- fix for exception on extreme zoom on NumberAxis (bug #64); +- fix for exception on extreme zoom on `NumberAxis` (bug #64); +- remove alpha channel from copy-to-clipboard (fixes bug #182); - apply rendering hints to overlays - fixes bug #187; -- added generics -- DefaultIntervalCategoryDataset no longer allows null keys in constructor (this - is a consequence of introducing generics) - removed ObjectUtils class (https://github.com/jfree/jfreechart/pull/163) -- removed unused URLUtilities class (https://github.com/jfree/jfreechart/pull/162) -- fixed LayeredBarRenderer bugs #169 and #175 -- update French translations (https://github.com/jfree/jfreechart/pull/186) -- fix "Save_as" entries in localisation files (https://github.com/jfree/jfreechart/pull/184). +- removed unused `URLUtilities` class (PR #162) +- fixed `LayeredBarRenderer` (bugs #169 and #175); +- update French translations (bug #186); +- fix "Save_as" entries in localisation files (bug #184); +- added generics; +- `DefaultIntervalCategoryDataset` no longer allows null keys in constructor (this + is a consequence of introducing generics); +- update required JDK to version 1.8. ##### Version 1.5.0 (5 November 2017) - all JavaFX classes moved to a separate project; diff --git a/src/main/java/org/jfree/chart/ChartTransferable.java b/src/main/java/org/jfree/chart/ChartTransferable.java index dea005d156..963c92fc3a 100644 --- a/src/main/java/org/jfree/chart/ChartTransferable.java +++ b/src/main/java/org/jfree/chart/ChartTransferable.java @@ -225,7 +225,7 @@ private BufferedImage createBufferedImage(JFreeChart chart, int w, int h, int minDrawW, int minDrawH, int maxDrawW, int maxDrawH) { BufferedImage image = new BufferedImage(w, h, - BufferedImage.TYPE_INT_ARGB); + BufferedImage.TYPE_INT_RGB); // bug #182 Graphics2D g2 = image.createGraphics(); // work out if scaling is required... @@ -238,8 +238,7 @@ private BufferedImage createBufferedImage(JFreeChart chart, int w, int h, scaleX = drawWidth / minDrawW; drawWidth = minDrawW; scale = true; - } - else if (drawWidth > maxDrawW) { + } else if (drawWidth > maxDrawW) { scaleX = drawWidth / maxDrawW; drawWidth = maxDrawW; scale = true; @@ -248,8 +247,7 @@ else if (drawWidth > maxDrawW) { scaleY = drawHeight / minDrawH; drawHeight = minDrawH; scale = true; - } - else if (drawHeight > maxDrawH) { + } else if (drawHeight > maxDrawH) { scaleY = drawHeight / maxDrawH; drawHeight = maxDrawH; scale = true;