Duncan Gibson wrote: >> Without going too deep into it (I'm still testing), I would like to >> ask for your opinions how to handle _negative_ widget sizes. >> >> Would it be sensible to assume that negative width and/or height means >> the same as 0, and that the widget is thus invisible? > > FWIW. my first comment, without having investigated further, is that > as long as we are consistently using platforms that all start with > (0,0) in the top left corner, we should not allow negative height and > width at all. I'm not even sure about allowing zero height and width.
Actually it's not a question of allowing it, but more what to do if it happens anyway. Personally I think that this is an undefined value, and any behavior would be okay. The test case is somewhat "pathological", i.e. the resizable() widget of a group is shrunk so much that it gets a _negative_ height. Of course this shouldn't happen at all - in this case the programmer could use a better size_range() of the window in question. I still have to check if we can do something against this in Fl_Group::resize(), or if we should only document it: "Don't do that" ;-) > If the code currently allows it, is it handled consistently everywhere? > What does it mean? An invisible widget? Where is the bounding box of a > group containing such a widget? Let's keep the lid on this can of worms, > keep it simple and work to the principle of least surprise... All good questions, and the simple answer would be: this is not allowed, and thus the behavior is undefined. Therefore _any_ behavior would be okay. Is this acceptable for all? Albrecht _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
