Re: Scrolling [SOLVED]
Re: Scrolling [SOLVED]
- Subject: Re: Scrolling [SOLVED]
- From: Graham Cox <email@hidden>
- Date: Sat, 16 Jan 2010 09:47:38 +1100
On 16/01/2010, at 9:19 AM, David Blanton wrote:
> - (void)drawRect:(NSRect)rect {
> [super drawRect:rect];
>
> ...
> if(m_scrolling)
> {
> NSLog(@"drawRect scrolling");
>
> float v = 100*[m_vScroller floatValue];
> float h = 100*(1-[m_hScroller floatValue]);
> m_main.m_bitmap.SetOrigin(h, v);
> }
>
>
> ...
>
> }
David, It's my belief that your drawing architecture is flawed. There should be no need/reason to modify the bitmap that you're displaying in the view when it scrolls. Instead, the dirty rects tell you which portion of the bitmap needs to be drawn/created. Think of the bitmap as your data model (even though it contains pixels). It has no business knowing the state of the view.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden