diff options
author | Paul Fisher <rao@gnu.org> | 1999-03-02 07:01:00 +0000 |
---|---|---|
committer | Paul Fisher <rao@gnu.org> | 1999-03-02 07:01:00 +0000 |
commit | 83bfa6ff763b9567919568baa893cd37f5ffe77c (patch) | |
tree | 24bc133cba91737b8bbcd10a183b4eb9b4aa9bdc /gnu/java/awt/peer | |
parent | c7c43c3038f6561f97bc6f92a6cf46212e91407b (diff) | |
download | classpath-83bfa6ff763b9567919568baa893cd37f5ffe77c.tar.gz |
(setPixels): Handle (width < scansize).
Diffstat (limited to 'gnu/java/awt/peer')
-rw-r--r-- | gnu/java/awt/peer/gtk/GtkImage.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gnu/java/awt/peer/gtk/GtkImage.java b/gnu/java/awt/peer/gtk/GtkImage.java index f2ff139bd..3c15cf55c 100644 --- a/gnu/java/awt/peer/gtk/GtkImage.java +++ b/gnu/java/awt/peer/gtk/GtkImage.java @@ -171,9 +171,19 @@ public class GtkImage extends Image implements ImageConsumer return; } - System.arraycopy (pixels, offset, - pixelCache, y * this.width + x, - pixels.length - offset); + if (scansize == width) + { + System.arraycopy (pixels, offset, + pixelCache, y * this.width + x, + pixels.length - offset); + } + else // skip over scansize-width for each row + { + for (int i = 0; i < height; i++) + System.arraycopy (pixels, offset + (i * scansize), + pixelCache, (y + i) * this.width + x, + width); + } } public synchronized void |