public void append(Message msg) { synchronized (msgs) { msgs.add(msg); int y = 0; for (Message m : msgs) y += m.sz().y; boolean b = sb.val >= sb.max; sb.max = y - ih(); if (b) sb.val = sb.max; } }
public void resize(Coord sz) { super.resize(sz); if (sb != null) { sb.resize(ih()); sb.move(new Coord(sz.x, 0)); int y = 0; for (Message m : msgs) y += m.sz().y; boolean b = sb.val >= sb.max; sb.max = y - ih(); if (b) sb.val = sb.max; } if (cbtn != null) cbtn.c = new Coord(sz.x - cbtn.sz.x - sb.sz.x - 3, 0); }