diff options
| author | Francis Kung <fkung@redhat.com> | 2006-11-22 16:46:16 +0000 |
|---|---|---|
| committer | Francis Kung <fkung@redhat.com> | 2006-11-22 16:46:16 +0000 |
| commit | 4c82aa9397ff8ce3d2ca6963ef5362b83fb65e18 (patch) | |
| tree | 6586005ddaa6595b4567fd385d0213de7768b01e /gnu/java/awt/peer/gtk/BufferedImageGraphics.java | |
| parent | 12cac163c19591c3dce17b85a34ac9fbfd5855ba (diff) | |
| download | classpath-4c82aa9397ff8ce3d2ca6963ef5362b83fb65e18.tar.gz | |
2006-11-22 Francis Kung <fkung@redhat.com>
* gnu/java/awt/peer/gtk/BufferedImageGraphics.java
(drawGlyphVector): Clip updated area to glyph bounds.
* gnu/java/awt/peer/gtk/CairoGraphics2D.java
(createPath): Eliminate distortion when pixel-shifting rectangles; separate
x-coordinate and y-coordinate pixel shifting.
(shifted): Removed method.
(shiftX): New method, recognising scaling transforms.
(shiftY): New method, recognising scaling transforms.
(walkPath): Separate x-coordinate and y-coordinate pixel shifting.
Diffstat (limited to 'gnu/java/awt/peer/gtk/BufferedImageGraphics.java')
| -rw-r--r-- | gnu/java/awt/peer/gtk/BufferedImageGraphics.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gnu/java/awt/peer/gtk/BufferedImageGraphics.java b/gnu/java/awt/peer/gtk/BufferedImageGraphics.java index d58b6c258..b89febd74 100644 --- a/gnu/java/awt/peer/gtk/BufferedImageGraphics.java +++ b/gnu/java/awt/peer/gtk/BufferedImageGraphics.java @@ -379,10 +379,17 @@ public class BufferedImageGraphics extends CairoGraphics2D public void drawGlyphVector(GlyphVector gv, float x, float y) { + // Find absolute bounds, in user-space, of this glyph vector + Rectangle2D bounds = gv.getLogicalBounds(); + bounds = new Rectangle2D.Double(x + bounds.getX(), y + bounds.getY(), + bounds.getWidth(), bounds.getHeight()); + + // Perform draw operation if (comp == null || comp instanceof AlphaComposite) { super.drawGlyphVector(gv, x, y); - updateBufferedImage(0, 0, imageWidth, imageHeight); + updateBufferedImage((int)bounds.getX(), (int)bounds.getY(), + (int)bounds.getWidth(), (int)bounds.getHeight()); } else { @@ -393,9 +400,6 @@ public class BufferedImageGraphics extends CairoGraphics2D g2d.setStroke(this.getStroke()); g2d.drawGlyphVector(gv, x, y); - Rectangle2D bounds = gv.getLogicalBounds(); - bounds = new Rectangle2D.Double(x + bounds.getX(), y + bounds.getY(), - bounds.getWidth(), bounds.getHeight()); drawComposite(bounds, null); } } |
