OT: Re: problem with logic/math
- From: "Eric M. Monsler" <emonsler beamreachnetworks com>
- To: Billy Patton <bpatton dal asp ti com>
- Cc: Gtk users <gtk-list gnome org>
- Subject: OT: Re: problem with logic/math
- Date: Wed, 25 Sep 2002 09:30:15 -0700
Billy,
I can't tell from the code posted whether shiftX and shiftY refer to the
center of the visible area, or not. But, I suspect not, based on the
fact that you need to adjust them as you scale. I suspect that they
represent the lower left corner, or something.
I suggest having the shiftX and shiftY refer to the unscaled coordinates
of the center of the viewable area. Then, they do not have to change on
zooming in and out, the image is just redrawn with the same center.
If the redraw() would be a hassle to change, you may get acceptable
visuals by just fixing the constants to be inverses of each other.
Youve got 0.6 and 1.4, but 1/1.4 != 0.6. Try (7.0/10.0) and (10.0/7.0),
or something, and you should get closer.
One other change that you may want to make will be to adjust the shift
quantity, currently "50", by the scaling. I think that you probably
want that change anyway, although I now see that if shiftX and shiftY
are scaled, a constant would work.
Eric
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]