Re: NSRulerView and inches

2010-01-22 Thread Quincey Morris
On Jan 21, 2010, at 16:26, Graham Cox wrote: > Note that rulers automatically deal with the view's zoom so you don't > normally have to factor that in manually. > > I'd say that letting the view do the scaling is definitely the easiest way to > do it, through its -scaleUnitSquareToSize: method.

Re: NSRulerView and inches

2010-01-21 Thread Graham Cox
On 22/01/2010, at 2:13 PM, Kyle Sluder wrote: > But that's different from blithely drawing the > resize handles at whatever scale AppKit has calculated for you. I didn't say I was. AppKit doesn't decide on the scale, the user does. Appkit merely sets up a transform to suit. The resize handles a

Re: NSRulerView and inches

2010-01-21 Thread Kyle Sluder
On Thu, Jan 21, 2010 at 5:37 PM, Graham Cox wrote: > OK understand, but why, when NSView does it for you using > -scaleUnitSquareToSize:? Because it makes drawing things consistently at 1:1 resolution easier. > Agree, if you always draw the resize handles at the same fixed size. However, > I f

Re: NSRulerView and inches

2010-01-21 Thread Graham Cox
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

Re: NSRulerView and inches

2010-01-21 Thread Kyle Sluder
On Thu, Jan 21, 2010 at 4:52 PM, Graham Cox wrote: > > On 22/01/2010, at 11:38 AM, Kyle Sluder wrote: > >> I disagree wholeheartedly. I'd use automatic frame/bounds scaling for >> resolution independence, but manually track scale factors for zooming. > > Seems like I probably haven't made myself v

Re: NSRulerView and inches

2010-01-21 Thread Graham Cox
On 22/01/2010, at 11:38 AM, Kyle Sluder wrote: > I disagree wholeheartedly. I'd use automatic frame/bounds scaling for > resolution independence, but manually track scale factors for zooming. Seems like I probably haven't made myself very clear then. What do you mean here by "manually tracking"

Re: NSRulerView and inches

2010-01-21 Thread Kyle Sluder
On Thu, Jan 21, 2010 at 4:26 PM, Graham Cox wrote: > I'd say that letting the view do the scaling is definitely the easiest way to > do it, through its -scaleUnitSquareToSize: method. It's true that elements > such as selection handles and whatnot probably need to compensate for the > view scal

Re: NSRulerView and inches

2010-01-21 Thread Graham Cox
On 22/01/2010, at 7:00 AM, Quincey Morris wrote: > In your data model, keep your sizes and locations in whatever units make the > most sense, then expect to *transform* the values to view units (which > depend, at least, on the view's zoom factor). In general, it's awkward to let > the view d

Re: NSRulerView and inches

2010-01-21 Thread Quincey Morris
On Jan 21, 2010, at 04:30, Milen Dzhumerov wrote: > I'm been involved with an app that has the ability to create documents in > various dimensions, including a way where you specify the width and height in > inches + the PPI. So, for example, the user can specify a document of size > 5in x 5in

NSRulerView and inches

2010-01-21 Thread Milen Dzhumerov
Hi all, I'm been involved with an app that has the ability to create documents in various dimensions, including a way where you specify the width and height in inches + the PPI. So, for example, the user can specify a document of size 5in x 5in with 300 PPI. From this definition, I'll have a do