From 2c5a88945e306c7db2408ce2d8832f9e6b27e127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 1 Sep 2007 13:33:51 +0000 Subject: [PATCH] fix more glitches: * invalidate the correct rect on WindowActivated() in case fDivider is not correclty maintained * don't cut off part of the label in Draw() by constraining the clipping in case the placement of the label is a little different than intented git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22135 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/TextControl.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/kits/interface/TextControl.cpp b/src/kits/interface/TextControl.cpp index 6784a07787..a4779d332b 100644 --- a/src/kits/interface/TextControl.cpp +++ b/src/kits/interface/TextControl.cpp @@ -354,10 +354,9 @@ BTextControl::Draw(BRect updateRect) break; } - BRect labelArea(x, fText->Frame().top, x + labelWidth, - ceilf(fontHeight.ascent + fontHeight.descent) + 1); + BRect labelArea(x, Bounds().top, x + labelWidth, Bounds().bottom); if (x < fDivider && updateRect.Intersects(labelArea)) { - labelArea.right = fDivider; + labelArea.right = fText->Frame().left - 3; BRegion clipRegion(labelArea); ConstrainClippingRegion(&clipRegion); @@ -606,8 +605,8 @@ BTextControl::WindowActivated(bool active) { if (fText->IsFocus()) { // invalidate to remove/show focus indication - BRect rect = Bounds(); - rect.left = fDivider; + BRect rect = fText->Frame(); + rect.InsetBy(-1, -1); Invalidate(rect); // help out embedded text view which doesn't