I'm working on an application that provides some kind of layout to
arrange boxes on a page, like in a sketch application.
As long as I do not zoom my view, I can get everything to work just
fine, moving the view, resize with handles, etc...
But I need to provide a zoom feature, which I implemented using
scaleUnitSquareToSize on the contentView of my NSScrollView.
The side effect is that, if a coordinate in the middle of the pixel (.
5) in 1:1 ratio is ok to draw a one pixel clear line, this is no
longer applicable when the view is zoomed. I tried messing around
with convertRect:fromView: and convertRect:toView: to get pixel in
window coordinate, round it, and ask the value back in view
coordinates without sucess, it seems convertion methods do not handle
correctly the zoom level applied to the view.
Another ting I may doing wrong is I intercept setFrame to move the
view at the right place, but maybe I should move the view the same
value as the pointer offset from the beginning of the drag, and try
to draw my stuffs "at the pixel" in drawRect: method
I would be happy to get some pointers to sample codes or advice from
people that did already implement this kind of things.