On Mon, 6 Mar 2000 11:08:54 +0100 (CET), [EMAIL PROTECTED] wrote:
> Hi,
>
> I'm designing a tiny NSActionCell subclass which doesn't do anything else
> that manage a couple (5) NSTextFieldCells next to each other. My problem is
> that the NSTextFieldCells draw over the bounds of the NSRect I'm giving them
> to draw in, resulting in clashes.

<snip>

> The funny thing is if I set the NSTextField to bordered, the border is drawn
> correctly (i.e. 150 pixels of width in the above example), but the string
> leaks over.
>
> Is this a known bug of NSTextFieldCell, or am I doing something wrong? Does
> anyone have some example code illustrating how this is supposed to work?

It's a known bug - the text drawing fails to limit itsself to the rectangle
it should draw in.  Unfortunately, a good fix really needs the text system
finishing so that we can cache layout information for text and have the text
only draw within the correct bounds.

I tried a workaround a while back of having the text cell drawing method save
its gstate, set a clipping rectangle, draw, and then restore the gstate - but
this proved too much of a performance penalty when you have something like a
matrix of cells.

You could use the smae trick for your cells though - as long as you aren't
wanting to redraw large numbers of your cells, the performance overhead won't
be noticable.

Reply via email to