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();