Re: Zoom prblems in print preview



Le samedi 08 octobre 2005 �0:01 +0200, Lutz M�a �it :
> On Fri, 2005-10-07 at 10:08 +0200, Jean Br�rt wrote:
> > -               zoom = jp->zoom_factor * factor * (xdpi + ydpi) / (72. *
> > 2.);
> > +               zoom = jp->zoom_factor * factor;
> 
> Reading the code, I am wondering what all the xdpi and ydpi stuff is
> for. Do you've got an idea? 
> 
> 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 == -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






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]