Skip to content

Commit 1f2922e

Browse files
hansonrhansonr
authored andcommitted
GraphicsConfiguration fix for STABLE BufferedImage;Character.toString(c)
1 parent 3d19260 commit 1f2922e

File tree

9 files changed

+19
-7
lines changed

9 files changed

+19
-7
lines changed
217 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200715193703
1+
20200718212919
217 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200715193703
1+
20200718212919
217 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/java/awt/GraphicsConfiguration.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,11 @@ public BufferedImage createCompatibleImage(int width, int height,
186186
}
187187

188188

189-
protected BufferedImage newBufferedImage(ColorModel cm, WritableRaster wr,
190-
boolean alphaPremultiplied, Hashtable<?, ?> properties) {
191-
return new BufferedImage(cm, wr, alphaPremultiplied, properties);
189+
protected BufferedImage newBufferedImage(ColorModel cm, WritableRaster wr, boolean alphaPremultiplied,
190+
Hashtable<?, ?> properties) {
191+
BufferedImage bi = new BufferedImage(cm, wr, alphaPremultiplied, properties);
192+
bi.getRaster().秘setStable(true);
193+
return bi;
192194
}
193195

194196
/**

sources/net.sf.j2s.java.core/src/java/awt/image/BufferedImage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ public Graphics2D createGraphics() {
13311331
秘g = new JSGraphics2D(秘canvas);
13321332
}
13331333

1334-
if (秘haveRaster()) {
1334+
if (秘haveRaster() && 秘isDataStolen()) {
13351335
// we need to draw the image now, because it might
13361336
// have pixels. Note that Java actually does not
13371337
// allow creating a Graphics from MemoryImageSource
@@ -1341,7 +1341,7 @@ public Graphics2D createGraphics() {
13411341
}
13421342
Object pix = 秘pix;
13431343
/**
1344-
* @j2sNative if (pix) pix.img = this;
1344+
* @j2sNative pix && (pix.img = this);
13451345
*
13461346
*/
13471347

sources/net.sf.j2s.java.core/srcjs/js/j2sClazz.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5365,6 +5365,11 @@ if(radix >= 2 && radix <= 36){
53655365
}
53665366
return -1;
53675367
}, 1);
5368+
5369+
m$(C$,"toString$C", function(c) {
5370+
return c;
5371+
}, 1);
5372+
53685373
m$(C$,"toString",
53695374
function(c){
53705375
if (arguments.length == 0) {

sources/net.sf.j2s.java.core/srcjs/swingjs2.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19366,6 +19366,11 @@ if(radix >= 2 && radix <= 36){
1936619366
}
1936719367
return -1;
1936819368
}, 1);
19369+
19370+
m$(C$,"toString$C", function(c) {
19371+
return c;
19372+
}, 1);
19373+
1936919374
m$(C$,"toString",
1937019375
function(c){
1937119376
if (arguments.length == 0) {

0 commit comments

Comments
 (0)