Re: Tracking visibleRect changes using Autolayout
Re: Tracking visibleRect changes using Autolayout
- Subject: Re: Tracking visibleRect changes using Autolayout
- From: Kyle Sluder <email@hidden>
- Date: Mon, 18 Feb 2013 00:17:19 -0800
On Sun, Feb 17, 2013, at 11:46 PM, iain wrote:
> I'll give this a go, does -setFrameSize just deal with the visible
> portion
> when inside an NSScrollView/NSClipView? If so, thank you, that's great.
No. You're missing my point.
You have -viewWillDraw, an override point at which you know your view
will draw. You don't need to track your visible rect. You will only be
asked to draw rects that intersect with your visible rect[1]. Just query
-getRectsBeingDrawn:count: from within -drawRect, and render your
waveform for those rects.
Or better yet, fork that work off to a background queue.
[1] If your view is layer-backed, this becomes a lot more complicated.
--Kyle Sluder
_______________________________________________
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