Some fixes to the scroll label.

* Render the text a the right location.

* Make the label grow properly.
This commit is contained in:
Mark de Wever 2008-09-21 10:33:57 +00:00
parent 2469e900fc
commit 11cccff142
2 changed files with 6 additions and 1 deletions

View file

@ -49,6 +49,8 @@
[row]
[column]
horizontal_grow = "true"
vertical_grow = "true"
[label]
id = "_label"

View file

@ -120,9 +120,12 @@ tpoint tscroll_label::get_content_best_size() const
void tscroll_label::set_content_size(const SDL_Rect& rect)
{
//maybe add a get best height for a label with a given width...
assert(label_);
// Set the dummy spacer.
find_spacer()->set_size(rect);
//maybe add a get best height for a label with a given width...
SDL_Rect size = { 0, 0, get_best_size().x, get_best_size().y };
label_->set_size(size);