[comp.sys.mac.programmer] THINK C Class library panorama confusion

d88-jwa@dront.nada.kth.se (Jon W{tte) (10/28/90)

Hello world,

As a last touch on version 1.0 of my program, I thought I'd
include a "change font size" thing. Now, my main window consists
of a panorama inside a scroll pane. The panoramas units are ==
leading + ascent + descent of the current font. When I change
the font size, I also call SetScales(). If I have scrolled the
panorama to the origin, everything is fine, but if I'm out in
the middle, some units down or to the right, the scroll pane
loses its grip on where the panorama is.

Say, I scrolled 4 clicks down at unit scale 12. If I now change
the scale to 9, I can scroll four clicks up, at 9 pixels each -
BUT after changing the scale, I'm no longer at line 4 at the top
of the window, but in the middle of line 5, so scrolling 4 * 9
pixels up leaves me in the middle of line 1 instead of at line 0.

(Gee, if you can make sense of that you're a genius :-)

Anyway, if I change the scale, the pane thinks I want to stay
at the current PIXEL position, when what I want to do is to stay
at the current UNIT position (line / whatever)

What should I do ? I'll summarize to the net if interest and
solutions com in...

								h+
h+@nada.kth.se
"Moof!(tm)"