From 9c46568249885085b710f76f00a56a12f5ee61c9 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 22 Mar 2004 02:30:35 +0000 Subject: [PATCH 1/1] fixed bug 500 darcs-hash:20040322023035-5007d-c8c5770c5c2e85a8e6134decce1545fa28ab0d55.gz --- Makefile | 2 +- src/org/ibex/Box.java | 9 +++++---- src/org/ibex/Template.java | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5e390cf..e704dcc 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -############################################################################# +############################################################################# # # The Ibex Makefile # diff --git a/src/org/ibex/Box.java b/src/org/ibex/Box.java index f51723f..f8b4bf5 100644 --- a/src/org/ibex/Box.java +++ b/src/org/ibex/Box.java @@ -178,8 +178,9 @@ public final class Box extends JSScope implements Scheduler.Task { if (texture != null) { if (texture.isLoaded) { minwidth = min(texture.width, maxwidth); minheight = min(texture.height, maxheight); } else { JS res = texture.stream; texture = null; throw new JSExn("image not found: "+res); } + } else { + Log.warn(Box.class, "perform() called with null texture"); } - MARK_REPACK; MARK_REFLOW; MARK_RESIZE; @@ -378,10 +379,9 @@ 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(CLIP)) { - cx1 = max(cx1, parent == null ? 0 : globalx); - cy1 = max(cy1, parent == null ? 0 : globaly); + cx1 = max(cx1, globalx); + cy1 = max(cy1, globaly); cx2 = min(cx2, globalx + width); cy2 = min(cy2, globaly + height); if (cx2 <= cx1 || cy2 <= cy1) return; @@ -697,6 +697,7 @@ public final class Box extends JSScope implements Scheduler.Task { fillcolor = newfillcolor; } else if(value instanceof JS) { texture = Picture.load((JS)value, this); + if (texture != null) perform(); } else { throw new JSExn("fill must be null, a String, or a stream, not a " + value.getClass()); } diff --git a/src/org/ibex/Template.java b/src/org/ibex/Template.java index 49748ac..2f3e2ac 100644 --- a/src/org/ibex/Template.java +++ b/src/org/ibex/Template.java @@ -295,6 +295,7 @@ public class Template { nodeStack.setSize(nodeStack.size() - 1); t.children.addElement(oldt); int oldt_lines = getLine() - oldt.startLine; + if (t.content == null) t.content = new StringBuffer(); for (int i=0; oldt_lines > i; i++) t.content.append('\n'); } } -- 1.7.10.4