Only draw if inside client rectangle

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2005-10-19 13:54:32 +00:00
parent 5d7836c47d
commit 011b3dcbef
3 changed files with 29 additions and 24 deletions

View File

@@ -487,7 +487,7 @@ void wxRichTextParagraphLayoutBox::Init()
}
/// Draw the item
bool wxRichTextParagraphLayoutBox::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& WXUNUSED(rect), int descent, int style)
bool wxRichTextParagraphLayoutBox::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style)
{
wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst();
while (node)
@@ -498,8 +498,13 @@ bool wxRichTextParagraphLayoutBox::Draw(wxDC& dc, const wxRichTextRange& range,
if (child && !child->GetRange().IsOutside(range))
{
wxRect childRect(child->GetPosition(), child->GetCachedSize());
child->Draw(dc, child->GetRange(), selectionRange, childRect, descent, style);
if (childRect.GetTop() > rect.GetBottom() || childRect.GetBottom() < rect.GetTop())
{
// Skip
}
else
child->Draw(dc, child->GetRange(), selectionRange, childRect, descent, style);
}
node = node->GetNext();