Re: updating NSView subclass
Re: updating NSView subclass
- Subject: Re: updating NSView subclass
- From: Mike Ferris <email@hidden>
- Date: Wed, 4 Dec 2002 12:50:45 -0800
If you're only invalidating the parts of the view that need redisplay
(using -setNeedsDisplayInRect:) then the rectangle passed to -drawRect:
will only be the part you need to redraw and you can pay attention to
that in your implementation to avoid drawing stuff that falls outside
the given rect. Note that NSView's display machinery can only handle a
single invalid rect, so if you need to update one little rect in the
upper-left and another little rect in the lower-right of the view, and
you call -setNeedsDisplayInRect: with each little rect, by the time
drawRect: gets called, the rect passed in will be the union of the two
invalidations (in other words most or all of the view, in this case.)
Mike Ferris
Begin forwarded message:
From: Alexander White <email@hidden>
Date: Wed Dec 4, 2002 12:27:39 PM US/Pacific
To: email@hidden
Subject: updating NSView subclass
Hello,
I am writting an app that performs animation within an NSView
subclass. The problem that I am having is that everytime I update the
NSView with -drawRect I have to redraw the entire area rather than
just the parts that have changes since the last update. Is there a
better approach.
A.W.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.