[interfacekit] Re: BBox::GetPreferredSize()
- From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
- To: interfacekit@xxxxxxxxxxxxx
- Date: Fri, 08 Jun 2007 15:19:51 +0200 CEST
Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx> wrote:
> * The "NOTE" near the end of the function is obviously incorrect. It
> doesn't make any sense to add the child's width to a value that
> includes
> the width of the label.
Indeed.
> * In case of a label string, the label placement and spacing is not
> taken
> into account. The computation of the label box rect in SetLabel()
> explains
> that the label is place at x = 10 and has 4 pixels of horizontal
> spacing to
> either side.
It's even worse than that; it uses the += operator on uninitialized
variables.
> * The "account for border" part is a riddle to me. Where is the
> padding
> coming from? And why does it differ depending on whether there's a
> label or
> not?
If you ask me, it doesn't make much sense - only that it has a
different border width depending on the type. With a label, it might
look better with more padding, though.
Anyway, the computations don't look correct to me at all.
Feel free to correct that to your likings, I would think. IMO
GetPreferredSize() in a BBox is as useful as in BView, at least when
there is no label.
Bye,
Axel.
- Follow-Ups:
- [interfacekit] Re: BBox::GetPreferredSize()
- From: Ingo Weinhold
- References:
- [interfacekit] BBox::GetPreferredSize()
- From: Ingo Weinhold
Other related posts:
- » [interfacekit] BBox::GetPreferredSize()
- » [interfacekit] Re: BBox::GetPreferredSize()
- » [interfacekit] Re: BBox::GetPreferredSize()
- [interfacekit] Re: BBox::GetPreferredSize()
- From: Ingo Weinhold
- [interfacekit] BBox::GetPreferredSize()
- From: Ingo Weinhold