Re: Autolayout frustrations with NSOutlineView [SOLVED, +follow-up question]
Re: Autolayout frustrations with NSOutlineView [SOLVED, +follow-up question]
- Subject: Re: Autolayout frustrations with NSOutlineView [SOLVED, +follow-up question]
- From: Graham Cox <email@hidden>
- Date: Wed, 30 Jul 2014 17:39:42 +1000
On 30 Jul 2014, at 5:20 pm, Quincey Morris <email@hidden> wrote:
> What I’m suggesting is that the document view and the canvas are not the same thing, and the canvas need not even be a view. The canvas bounds and the document view bounds are not the same thing, in general:
>
> — The document view bounds are forced to be at least as large as the clip bounds.
>
> — The document view bounds are forced to be at least as large as the canvas bounds, in the canvas’s current scale.
>
> Thus, if the canvas is smaller than the clip view (in either or both dimensions), it is simply drawn within the document view. This can be achieved either by making the canvas a subview of the document view, or by drawing in the document view itself but limiting the drawing to the bounds of the canvas, in the dimensions that the canvas is smaller.
>
I do understand - you're suggesting that I interpose a view between my canvas and the clip view, and do the centering/shadow adornment there. I did mention this possibility in my previous message, but to me it seems to simply be shifting the problem to another place, not solving it. If I have another view there to do this, it may as well be the clip view, which is how I've handled this in previous versions.
The question is, would autolayout constraints allow the conditional centering behaviour I want, and if so, how to do that? If these constraints can't be applied between the clip view and the content for some reason to do with the way NSClipView works, then another view might be a solution. But if constraints can't do what I want anyway, I may as well go back to the custom clip view approach.
The 'canvas' is a view, and it does have to be a view, because that's the design I'm working with (this isn't set in concrete, but it's something that I would rather not change if possible). You mentioned ruler views - with the canvas being the document content view, these just work as the frame and 'unit square' of the content view changes. With a different view in there, they wouldn't - I'd have to do extra work to make them scale and align to the canvas.
--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