Re: scroll bars and visible rect
Re: scroll bars and visible rect
- Subject: Re: scroll bars and visible rect
- From: Andy Lee <email@hidden>
- Date: Fri, 04 Jan 2013 21:18:32 -0800
On Jan 4, 2013, at 8:00 PM, Graham Cox <email@hidden> wrote:
>
> On 05/01/2013, at 1:08 PM, Andy Lee <email@hidden> wrote:
>
>> Put this all together and clearly the document view's visibleRect does not include any of the area occupied by the scroll bars.
>>
>> But maybe I am answering the wrong question, in which case... never mind.
>
>
> I understood the question to mean what you thought as well.
>
> But while the visibleRect does not include the area occupied by the scroll bars, it will change according to whether the scroll bars are shown or hidden. If they're hidden, the clip view expands to take up the room the scrollbars used to occupy, and so the area of the content view gets larger, along with the visibleRect. This must be true since more content is revealed when scrollbars hide (otherwise why do it?).
Yup. The only thing I wonder about is the case where the user has chosen to have scrollbars visible only during scrolling. I don't use this mode myself, but I turned it on to have a look. It looks like in this mode, the clip view doesn't resize, and instead translucent scroll bars are drawn on top of it. No NSScrollers are added as subviews.
> That's my understanding. It would be easily verified with a simple test case.
Yeah, it seems to me it would be easy to test. I would assume the translucent scroll bars in this case don't affect the visible rect, but if it was important I would test. Anyway, the OP seems to feel he's figured out the answer he needed.
I also wonder about the "what are you really trying to do" part -- as you mentioned, scroll views already do clipping for you.
There's a couple of +contentSizeFor... class methods that might help. But at this point I don't have much more to add.
--Andy
_______________________________________________
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