mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
partial fix was applied to solve window reszing to zero height issue
This commit is contained in:
@@ -2254,7 +2254,12 @@ public class PApplet implements PConstants {
|
||||
// if (!primary) {
|
||||
// surface.initImage(pg, w, h);
|
||||
// }
|
||||
pg.setSize(w, h);
|
||||
if(w <= 0 and h <= 0) { //setting size to 0 if size is invalid
|
||||
pg.setSize(0, 0);
|
||||
} else {
|
||||
pg.setSize(w, h);
|
||||
}
|
||||
|
||||
|
||||
// everything worked, return it
|
||||
return pg;
|
||||
@@ -2299,6 +2304,8 @@ public class PApplet implements PConstants {
|
||||
if (e.getMessage().contains("cannot be <= 0")) {
|
||||
// IllegalArgumentException will be thrown if w/h is <= 0
|
||||
// http://code.google.com/p/processing/issues/detail?id=983
|
||||
|
||||
// a fix should be done here to resize the window back to 0 if new size is not valid
|
||||
throw new RuntimeException(e);
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user