diff --git a/core/src/processing/core/PGraphicsJava2D.java b/core/src/processing/core/PGraphicsJava2D.java index 853f5496a..634a4cdbb 100644 --- a/core/src/processing/core/PGraphicsJava2D.java +++ b/core/src/processing/core/PGraphicsJava2D.java @@ -1335,6 +1335,7 @@ public class PGraphicsJava2D extends PGraphics { int tintedColor; int[] tintedTemp; // one row of tinted pixels BufferedImage image; +// BufferedImage compat; // public ImageCache(PImage source) { //// this.source = source; @@ -1484,6 +1485,15 @@ public class PGraphicsJava2D extends PGraphics { } this.tinted = tint; this.tintedColor = tintColor; + +// GraphicsConfiguration gc = parent.getGraphicsConfiguration(); +// compat = gc.createCompatibleImage(image.getWidth(), +// image.getHeight(), +// Transparency.TRANSLUCENT); +// +// Graphics2D g = compat.createGraphics(); +// g.drawImage(image, 0, 0, null); +// g.dispose(); } } @@ -1750,6 +1760,7 @@ public class PGraphicsJava2D extends PGraphics { g2.setColor(fillColorObject); int length = stop - start; + if (length != 0) { g2.drawChars(buffer, start, length, (int) (x + 0.5f), (int) (y + 0.5f)); // better to use round here? also, drawChars now just calls drawString // g2.drawString(new String(buffer, start, stop - start), Math.round(x), Math.round(y)); @@ -1762,6 +1773,7 @@ public class PGraphicsJava2D extends PGraphics { // java.awt.font.GlyphVector gv = // font.createGlyphVector(g2.getFontRenderContext(), new String(buffer, start, stop - start)); // g2.drawGlyphVector(gv, x, y); + } // return to previous smoothing state if it was changed //g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, textAntialias); diff --git a/core/todo.txt b/core/todo.txt index b7284bee1..77a87ebb4 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -37,6 +37,8 @@ high _ zero alpha values still a problem with retina renderer _ https://github.com/processing/processing/issues/2030 _ Sort out blending differences with P2D/P3D +_ might be that compatible images not setting alpha mode correctly +_ image = gc.createCompatibleVolatileImage(source.width, source.height, Transparency.TRANSLUCENT); _ https://github.com/processing/processing/issues/1844 _ 'collector' class.. Dict that points to a list _ String as a key, int/float/string list as values