Skip to content

Commit

Permalink
UI|Client: Tweaked clip-culling for scrolling
Browse files Browse the repository at this point in the history
When scrolling, it is beneficial to have things ready before they
become visible. Clip-culling will now use a hardcoded safety boundary
around the widget’s actual rectangle.
  • Loading branch information
skyjake committed Jan 3, 2014
1 parent 9b2f76e commit 5fed004
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doomsday/client/src/ui/framework/guiwidget.cpp
Expand Up @@ -162,8 +162,10 @@ DENG2_OBSERVES(ui::Margins, Change)

if(self.clipped())
{
int const CULL_SAFETY_WIDTH = 100; // avoid pop-in when scrolling

// Clipped widgets are guaranteed to be within their rectangle.
return !visibleArea.overlaps(self.rule().recti());
return !visibleArea.overlaps(self.rule().recti().expanded(CULL_SAFETY_WIDTH));
}
// Otherwise widgets may draw anywhere in the view.
return visibleArea.isNull();
Expand Down

0 comments on commit 5fed004

Please sign in to comment.