if (g.p != null)
buf.drawPictureAlphaOnly(g.p,
x,
- y + g.max_ascent - g.baseline - g.max_descent,
+ y + g.max_ascent - g.baseline + g.max_descent,
x + g.p.getWidth(),
- y + g.max_ascent - g.baseline + g.p.getHeight() - g.max_descent,
+ y + g.max_ascent - g.baseline + g.max_descent + g.p.getHeight(),
0, 0,
g.p.getWidth(), g.p.getHeight(),
textcolor);
static {
specialBoxProperties.put("fill", new ColorBoxProperty() {
+ public void put(Box b, Object value) {
+ if (value != null && value instanceof Res) {
+ b.image = Picture.fromRes((Res)value);
+ b.minwidth = b.image.getWidth();
+ b.minheight = b.image.getHeight();
+ b.dirty();
+ } else {
+ super.put(b, value);
+ }
+ }
public int getColor(Box b) { return b.fillcolor; }
public void putColor(Box b, int argb) { b.fillcolor = argb; }
});
return new Integer(b.x);
}
public void put(Box b, Object value) {
- if (!((b.flags & NOTPACKED_FLAG) != 0)) return;
+ if (!((b.flags & NOTPACKED_FLAG) != 0) && (b.parent != null || b.surface == null)) return;
int x = stoi(value);
if (x == b.x) return;
b.dirty();
specialBoxProperties.put("width", new SpecialBoxProperty() {
public Object get(Box b) { return new Integer(b.width); }
public void put(Box b, Object value) {
- b.width = stoi(value);
+ int width = stoi(value);
if (b.parent == null && b.surface != null) {
+ b.width = width;
b.surface.setSize();
MARK_FOR_REFLOW_b;
} else {
- if (b.minwidth == b.width && b.maxwidth == b.width) return;
- b.minwidth = b.maxwidth = b.width;
+ if (b.minwidth == width && b.maxwidth == width) return;
+ b.minwidth = b.maxwidth = width;
MARK_FOR_REFLOW_b;
}
} });