Re: Zoom prblems in print preview

Jean Bréfort <[email protected]> Sat, 08 Oct 2005 08:28:20 +0200
Newsgroups gmane.comp.gnome.print
Message-ID <[email protected]>
Le samedi 08 octobre 2005 =C3=A0 00:01 +0200, Lutz M=C3=BCller a =C3=A9cr=
it :
> On Fri, 2005-10-07 at 10:08 +0200, Jean Br=C3=A9fort wrote:
> > -               zoom =3D jp->zoom_factor * factor * (xdpi + ydpi) / (=
72. *
> > 2.);
> > +               zoom =3D jp->zoom_factor * factor;
>=20
> Reading the code, I am wondering what all the xdpi and ydpi stuff is
> for. Do you've got an idea?=20
>=20
> If not, I'll patch as suggested and remove the 30+ lines above that are
> commented out or are intended to calculate the no longer used values
> xdpi/ydpi.

I suppose it was there to obtain a devie independent result, but it
would make sense if it was used when first displaying the preview (i.e.
when factor =3D=3D -1), but not later.
Before version 1.68, the factor was applied when calling
gnome_canvas_set_pixels_per_unit:

gnome_canvas_set_pixels_per_unit (priv->canvas, mp->zoom * (xdpi +
ydpi) / (72. * 2.));

This is more logic IMHO (and works). You made this change... nobody is
perfect ;-)

There are three solutions:
- restore the gnome_canvas_set_pixel_per_unit line as it was in 1.67;
- multiply zoom factor by (xdpi + ydpi) / (72. * 2.) when factor is -1;
- drop it.

Cheers,
Jean