Avoid redrawing the window twice.

The grid didn't clear tgrid properly so added a manual clearing. The
code doesn't look too great since too many people clear the dirty state,
which should be fixed later.
This commit is contained in:
Mark de Wever 2009-06-01 16:59:01 +00:00
parent 8b65d8a521
commit 64b998da24
2 changed files with 5 additions and 0 deletions

View file

@ -828,6 +828,7 @@ void tgrid::layout(const tpoint& origin)
void tgrid::impl_draw_children(surface& frame_buffer)
{
assert(get_visible() == twidget::VISIBLE);
set_dirty(false);
foreach(tchild& child, children_) {

View file

@ -566,6 +566,10 @@ void twindow::draw()
dirty_list_.clear();
std::vector<twidget*> call_stack;
populate_dirty_list(*this, call_stack);
assert(dirty_list_.empty());
SDL_Rect rect = get_rect();
update_rect(rect);
cursor::draw(frame_buffer);