Make sure to invalidate the region that was previously within the text rect,

but which is outside the new text rect, when changing the text rect. Solves
dirty regions in BTextViews. For example the black bar along the top of the 
URL input in WebPositive after starting it. Or random bits of text left-over
in Beam when switching emails.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36470 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2010-04-25 14:29:38 +00:00
parent 3417c110cf
commit 5af798836a
+6
View File
@@ -2231,6 +2231,7 @@ BTextView::TextRect() const
void
BTextView::_ResetTextRect()
{
BRect oldTextRect(fTextRect);
// reset text rect to bounds minus insets ...
fTextRect = Bounds().OffsetToCopy(B_ORIGIN);
fTextRect.left += fLayoutData->leftInset;
@@ -2241,6 +2242,11 @@ BTextView::_ResetTextRect()
// and rewrap (potentially adjusting the right and the bottom of the text
// rect)
_Refresh(0, TextLength(), false);
// Make sure that the dirty area outside the text is redrawn too.
BRegion invalid(oldTextRect | fTextRect);
invalid.Exclude(fTextRect);
Invalidate(&invalid);
}