Skip navigation.
 
mlRe: extra redrawing with [self setBounds:] in drawRect:
FROM : Jim Correia
DATE : Tue Jan 29 03:32:42 2008

On Jan 28, 2008, at 8:43 PM, Nathan Vander Wilt wrote:

> extra redrawing with [self setBounds:] in drawRect:
>
>
> In my custom view, I set the bounds in my drawRect:
> method before drawing. This is so that while the user
> is resizing the window, the content stretches with the
> view.


[...]

> Somehow this selection rectangle code triggers random
> extra redrawing.


It is unclear why you need to resize your view inside of -drawRect:. 
This is surely the root cause of your problem.

If your view cannot be automatically resized when the window is 
resized via springs and struts, use the appropriate mechanism to 
adjust the view's frame.

Resizing the view inside of -drawRect: doesn't sound like good design. 
And it isn't terribly surprising that it might confuse the code which 
tracks view invalidation.

Jim

Related mailsAuthorDate
mlextra redrawing with [self setBounds:] in drawRect: Nathan Vander Wilt Jan 29, 02:43
mlRe: extra redrawing with [self setBounds:] in drawRect: Jim Correia Jan 29, 03:32
mlRe: extra redrawing with [self setBounds:] in drawRect: Nathan Vander Wilt Jan 29, 03:58