From c00709f3cca592226f6f6bc1e8caa455d2ced0d5 Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 07:43:15 +0000 Subject: [PATCH] 2003/12/25 23:54:52 darcs-hash:20040130074315-2ba56-497de719a91210c249e167645ff6e4a744ce2052.gz --- src/org/xwt/Box.java | 5 +++-- src/org/xwt/translators/PNG.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/org/xwt/Box.java b/src/org/xwt/Box.java index 0e4a30b..3e2599b 100644 --- a/src/org/xwt/Box.java +++ b/src/org/xwt/Box.java @@ -176,8 +176,8 @@ public final class Box extends JSScope implements Scheduler.Task { // FIXME; we can't assume that just because we were performed the image is loaded. // as external events have occured, check the state of box if (texture != null) { - if (texture.isLoaded) { minwidth = texture.width; minheight = texture.height; } - else { Res res = texture.res; texture = null; throw new JSExn("image not found: "+res); } + if (texture.isLoaded) { minwidth = min(texture.width, maxwidth); minheight = min(texture.height, maxheight); } + else { Res res = texture.res; texture = null; throw new JSExn("image not found: "+res); } } MARK_REPACK; @@ -355,6 +355,7 @@ public final class Box extends JSScope implements Scheduler.Task { int globaly = parenty + (parent == null ? 0 : y); // intersect the x,y,w,h rendering window with ourselves; quit if it's empty + if (!test(NOCLIP)) { cx1 = max(cx1, parent == null ? 0 : globalx); cy1 = max(cy1, parent == null ? 0 : globaly); diff --git a/src/org/xwt/translators/PNG.java b/src/org/xwt/translators/PNG.java index a3578f9..6b7b11f 100644 --- a/src/org/xwt/translators/PNG.java +++ b/src/org/xwt/translators/PNG.java @@ -33,6 +33,7 @@ public class PNG { if (g == null) g = new PNG(); try { g._load(is, p); + p.data = g.data; } catch (Exception e) { if (Log.on) Log.log(PNG.class, e); return; @@ -59,7 +60,7 @@ public class PNG { if ((inputStream.read() != 137) || (inputStream.read() != 80) || (inputStream.read() != 78) || (inputStream.read() != 71) || (inputStream.read() != 13) || (inputStream.read() != 10) || (inputStream.read() != 26) || (inputStream.read() != 10)) { Log.log(this, "PNG: error: input file is not a PNG file"); - data = new int[] { }; + data = p.data = new int[] { }; p.width = p.height = 0; return; } @@ -558,7 +559,7 @@ public class PNG { private boolean complete = false; private boolean error = false; - private int[] data = null; + int[] data = null; private InputStream underlyingStream = null; private DataInputStream inputStream = null; -- 1.7.10.4