FROM : Graham Cox
DATE : Tue Oct 14 15:44:17 2008
On 15 Oct 2008, at 12:38 am, Antonio Nunes wrote:
> As you can see from the image it looks like the view first draws
> itself correctly, then gets drawn for each of the other subviews,
> with its origin offset to match the origin of the subview in
> question. I don't understand why this happens.
You've made the classic error of assuming that 'rect' passed to
drawRect: is your view's bounds. It's not. It's the area requiring
update.
Replace all references to 'rect' with [self bounds] and all will be
well. This must crop up at least once or twice a month.
hth,
Graham
DATE : Tue Oct 14 15:44:17 2008
On 15 Oct 2008, at 12:38 am, Antonio Nunes wrote:
> As you can see from the image it looks like the view first draws
> itself correctly, then gets drawn for each of the other subviews,
> with its origin offset to match the origin of the subview in
> question. I don't understand why this happens.
You've made the classic error of assuming that 'rect' passed to
drawRect: is your view's bounds. It's not. It's the area requiring
update.
Replace all references to 'rect' with [self bounds] and all will be
well. This must crop up at least once or twice a month.
hth,
Graham
| Related mails | Author | Date |
|---|---|---|
| Antonio Nunes | Oct 14, 15:38 | |
| Benjamin Stiglitz | Oct 14, 15:43 | |
| Graham Cox | Oct 14, 15:44 | |
| Antonio Nunes | Oct 14, 16:16 |






Cocoa mail archive

