On 22/01/2010, at 12:04 PM, Kyle Sluder wrote:

> I would have a separate "zoomFactor" property on my view,

Yes, so would I...

> and use that
> inside -drawRect: to create a scaling transformation.

OK understand, but why, when NSView does it for you using 
-scaleUnitSquareToSize:?

> Drawing UI
> adornments (resize handles, focus rings, etc.) at different sizes
> depending on zoom is bad UI, particularly when the user zooms out. And
> why bother rescaling it back to native size (and potentially dealing
> with rounding errors leading to non-integral coordinates and
> blurriness) when you could just avoid scaling it in the first place?

Agree, if you always draw the resize handles at the same fixed size. However, I 
found that usability was improved noticeably when these elements are allowed to 
scale, but only in some smaller proportion of the main zoom factor. For 
example, I use 33% of the main zoom as the scale factor for resize handles, 
except if the view is zoomed out in which case a limit is applied so that the 
handles do not become smaller than a certain size. There's also a limit applied 
at the upper end as well. This makes sense for general graphic manipulation, 
though possibly not for every conceivable case however (e.g. I don't use focus 
rings as a highlighting method for "content").

I guess it's not going to make a huge difference whether you apply your own 
transform to the "content" drawing or let NSView do it, the content gets drawn 
correctly either way. However, if you do handle your own transform, doesn't the 
ruler scaling management become really painful? I'm just asking - I haven't 
tried this approach so I haven't explored what you have to do with the rulers 
to make this work.

> There are lots of things Cocoa does for you automatically that are 80%
> solutions. NSController, anyone?

True, but in this case I haven't found a need to do much other than standard 
with NSRulerView. I just set the rulers to match my base coordinate system and 
it truly "just works".


> No, I think you understood me (or at least you were aware of the
> method I prefer).

Well, I do now. I think it's a relatively small difference after all - I 
thought you might have been talking about a much different approach, so thanks 
for the clarification.

--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to