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:
parent
8b65d8a521
commit
64b998da24
2 changed files with 5 additions and 0 deletions
|
@ -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_) {
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue