_BTextInput_: Only invalidate parent when in a window.

* Otherwise there is nothing to it.
* Removed comment and commented out invalidation. Seems to work
  just fine without it, and I cannot think of a reason why it should
  be there.
This commit is contained in:
Axel Dörfler
2015-03-27 13:24:10 +01:00
parent ccc3ced21c
commit 06cdb6558f
+3 -5
View File
@@ -140,16 +140,14 @@ _BTextInput_::MakeFocus(bool state)
fPreviousText = NULL;
}
// if (Window()) {
// TODO: why do we have to invalidate here?
// I'm leaving this in, but it looks suspicious... :-)
// Invalidate(Bounds());
if (Window() != NULL) {
// Invalidate parent to draw or remove the focus mark
if (BTextControl* parent = dynamic_cast<BTextControl*>(Parent())) {
BRect frame = Frame();
frame.InsetBy(-1.0, -1.0);
parent->Invalidate(frame);
}
// }
}
}