Re: NSRulerView Fast Scrolling Issues
Re: NSRulerView Fast Scrolling Issues
- Subject: Re: NSRulerView Fast Scrolling Issues
- From: David Harper <email@hidden>
- Date: Thu, 3 Jan 2008 13:33:03 -0500 (EST)
Hi,
That was exactly the assumption that caused the problems in the first place. The way I corrected it was by comparing the bounds rectangle of the scroll view's content view before and after the draw method was called. This gives the correct scroll offset.
// update the scroll origin based on the amount scrolled
float dy = curScrollY - [[[self scrollView] contentView] bounds].origin.y;
curScrollY = [[[self scrollView] contentView] bounds].origin.y;
scrollOrigin += dy;
Thanks,
- Dave H.
Alastair Houghton <email@hidden> wrote: On 3 Jan 2008, at 16:36, David Harper wrote:
> I am still trying to perfect the performance of the NSRulerView
> subclass in my application. What I know so far is as follows:
>
> 1. the rectangle passed into drawHashMarksAndLabelsInRect:
> represents the amount scrolled since the last time the rulerview was
> drawn.
You can't make that assumption, which is why things aren't working for
you. Why do you need to know how much the rulerview has scrolled by?
The NSRulerView code will already be copying pixels where appropriate
anyway, so if you're trying somehow to "optimise" drawing, you're
duplicating system functionality.
Perhaps you can explain what the performance problem is that you're
trying to solve?
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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