STR #1133: if the FIle_input did not have focus and have no text inside and have the BAR changed flags set, it would draw a bogus and shifted second background box on top of the original one.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4728 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2005-12-30 15:45:38 +00:00
parent 0ea6761db2
commit a5b959a3df

View File

@ -167,9 +167,14 @@ void
Fl_File_Input::draw() {
Fl_Boxtype b = box();
if (damage() & (FL_DAMAGE_BAR | FL_DAMAGE_ALL)) draw_buttons();
if (damage() & FL_DAMAGE_ALL) draw_box(b,x(),y()+DIR_HEIGHT,w(),h()-DIR_HEIGHT,color());
Fl_Input_::drawtext(x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b)+DIR_HEIGHT,
w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b)-DIR_HEIGHT);
// this flag keeps Fl_Input_::drawtext from drawing a bogus box!
char must_trick_fl_input_ =
Fl::focus()!=this && !size() && !(damage()&FL_DAMAGE_ALL);
if ((damage() & FL_DAMAGE_ALL) || must_trick_fl_input_)
draw_box(b,x(),y()+DIR_HEIGHT,w(),h()-DIR_HEIGHT,color());
if (!must_trick_fl_input_)
Fl_Input_::drawtext(x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b)+DIR_HEIGHT,
w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b)-DIR_HEIGHT);
}