From: megacz Date: Fri, 30 Jan 2004 07:35:37 +0000 (+0000) Subject: 2003/09/16 05:02:44 X-Git-Tag: RC3~614 X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=cbf3213acd633866b3e686358d3eb3d7f657cd4a 2003/09/16 05:02:44 darcs-hash:20040130073537-2ba56-5405dea7567ab1a55983d4c0fe04be391d688b7c.gz --- diff --git a/Makefile b/Makefile index e38135e..73093fe 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ all_java_sources := $(patsubst src/%.java, build/java/%.java, $(shell find all_java_sources += $(patsubst src/%.java.pp, build/java/%.java, $(shell find src -name '*.java.pp')) superclass_org.xwt.plat.Platform:; -ifeq ($(platform),) +ifneq ($(platform),) plat_deps := $(shell make -s superclass_org.xwt.plat.$(platform) platform= ) endif diff --git a/src/org/xwt/Box.java.pp b/src/org/xwt/Box.java.pp index 50ef309..959deff 100644 --- a/src/org/xwt/Box.java.pp +++ b/src/org/xwt/Box.java.pp @@ -204,7 +204,11 @@ public final class Box extends JS.Scope { /** Checks if the Box's size has changed, dirties it if necessary, and makes sure childrens' sizes are up to date */ void repack() { if (!needs_reflow) return; - if (numChildren() == 0) { contentwidth = minwidth; contentheight = minheight; return; } + if (numChildren() == 0) { + contentwidth = max(textwidth, minwidth); + contentheight = max(textheight, minheight); + return; + } // --- Phase 0 ---------------------------------------------------------------------- // recurse @@ -393,7 +397,7 @@ public final class Box extends JS.Scope { if (tile) renderTiledImage(globalx, globaly, clipx, clipy, clipw, cliph, buf); else renderStretchedImage(globalx, globaly, clipx, clipy, clipw, cliph, buf); - //if (text != null && !text.equals("")) renderText(x, y, w, h, buf); + if (text != null && !text.equals("")) renderText(x, y, clipx, clipy, clipw, cliph, buf); // now subtract the pad region from the clip region before proceeding clipw = min(max(clipx, globalx + hpad) + clipw, globalx + width - hpad) - clipx; @@ -445,11 +449,21 @@ public final class Box extends JS.Scope { } } - void renderText(int x, int y, int w, int h, DoubleBuffer buf) { - /* - if ((textcolor & 0xFF000000) == 0x00000000) return; - buf.setClip(x, y, w + x, h + y); + void renderText(int x, int y, int clipx, int clipy, int clipw, int cliph, DoubleBuffer buf) { + + Log.log(this, "rendering text: " + text); + //buf.setClip(clipx, clipy, clipw, cliph); + try { + ImageDecoder id = org.xwt.imp.Font.render(new FileInputStream("COMIC.TTF"), 24, text); + Picture p = Platform.createPicture(id); + buf.drawPicture(p, x, y); + buf.setClip(0, 0, buf.getWidth(), buf.getHeight()); + } catch (Exception e) { + Log.log(this, e); + } + + /* buf.drawString(font(), text, x + hpad, y + vpad + Platform.getMaxAscent(font()) - 1, textcolor); buf.setClip(0, 0, buf.getWidth(), buf.getHeight()); int i=0; while(i