some interface bugs fixed,

added option to choose between zoom & scale when zooming in MainForm
This commit is contained in:
zueuk
2006-09-18 15:52:16 +00:00
parent e72eee7dd9
commit eac94ba8a1
10 changed files with 154 additions and 44 deletions

View File

@ -1702,7 +1702,10 @@ begin
center[0] := center[0] + cos(FAngle) * dx - sin(FAngle) * dy;
center[1] := center[1] + sin(FAngle) * dx + cos(FAngle) * dy;
zoom := Log2(scale * ( Width/(abs(r.Right - r.Left) + 1)));
if PreserveQuality then
zoom := Log2(scale * ( Width/(abs(r.Right - r.Left) + 1)))
else
pixels_per_unit := pixels_per_unit * Width / abs(r.Right - r.Left);
end;
///////////////////////////////////////////////////////////////////////////////
@ -1711,7 +1714,11 @@ var
ppu: double;
dx, dy: double;
begin
zoom := Log2(power(2, zoom) / ( Width/(abs(r.Right - r.Left) + 1)));
if PreserveQuality then
zoom := Log2(power(2, zoom) / ( Width/(abs(r.Right - r.Left) + 1)))
else
pixels_per_unit := pixels_per_unit / Width * abs(r.Right - r.Left);
ppu := pixels_per_unit * power(2, zoom);
dx := ((r.Left + r.Right)/2 - Width/2) / ppu;