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

(mgp-users 00101) Re: fix for bug in scaling images



I think current grammer.y does not left x/yzoomrate of zero value,
assign to 100 instead.  So the change to draw.c is not needed?

The change of postscript.c has been applied in rev. 1.8 (1998/12/23).

Try ftp://sh.wide.ad.jp/WIDE/free-ware/mgp-snap/mgp-snap-990215.tar.gz

Thanks,
Atsushi

> At some point near december a bug was introduced in the scaling of mgp
> images, resulting often in incorrect computation of image sizes.
> The following patch from Davide Devoti should fix things. I consider
> this rather critical

> --- draw.c.orig Thu Dec 17 05:32:33 1998
> +++ draw.c      Tue Feb  9 15:20:10 1999
> @@ -2543,7 +2670,8 @@
>  #endif
> 
>         if (backflag) {
> -               if (xzoomrate != 100 || yzoomrate != 100) {
> +               if ((xzoomrate != 100 || yzoomrate != 100) && !(xzoomrate==0 &&
> +                               yzoomrate==0)) {
>                         image = myimage;
>                         myimage = zoom(image, xzoomrate, yzoomrate, verbose);
>                         if (!image) {
> --- postscript.c.orig   Thu Dec 17 06:09:22 1998
> +++ postscript.c        Sun Feb  7 10:16:35 1999
> @@ -208,6 +208,6 @@
>         if (mgp_flag & FL_VERBOSE) {
>                 fprintf(stderr, "resulting zoom=(%f,%f)\n", x, y);
>         }
> -       *xp = (int)x * 100;
> -       *yp = (int)y * 100;
> +       *xp = (int)(x * 100);
> +       *yp = (int)(y * 100);
>  }
> 
> -----------------------------------+-------------------------------------
>   Luigi RIZZO                      .
>   EMAIL: luigi@iet.unipi.it        . Dip. di Ing. dell'Informazione
>   HTTP://www.iet.unipi.it/~luigi/  . Universita` di Pisa
>   TEL/FAX: +39-050-568.533/522     . via Diotisalvi 2, 56126 PISA (Italy)
> -----------------------------------+-------------------------------------
>