ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/psign.c
(Generate patch)

Comparing ray/src/px/psign.c (file contents):
Revision 2.9 by greg, Tue Jul 7 17:35:42 1992 UTC vs.
Revision 2.10 by greg, Tue Jul 7 18:24:34 1992 UTC

# Line 165 | Line 165 | makemap()                      /* create the bit map */
165                          cwidth = cheight/aspect + 0.5;
166                          xsiz = (long)maxwidth*cwidth >> 8;
167                          ysiz = nlines*cheight;
168 <                } else {
168 >                } else if (aspect > FTINY) {
169                          pictaspect = 256*nlines*aspect/maxwidth;
170                          if (pictaspect*xsiz < ysiz)
171                                  ysiz = pictaspect*xsiz + 0.5;
# Line 173 | Line 173 | makemap()                      /* create the bit map */
173                                  xsiz = ysiz/pictaspect + 0.5;
174                          cheight = ysiz/nlines;
175                          cwidth = cheight/aspect + 0.5;
176 +                } else {
177 +                        pictaspect = (double)ysiz/xsiz;
178 +                        aspect = pictaspect*maxwidth/(256*nlines);
179 +                        cheight = ysiz/nlines;
180 +                        cwidth = cheight/aspect + 0.5;
181                  }
182          } else {                        /* reverse orientation */
183                  if (xsiz == 0 || ysiz == 0) {
184                          cwidth = cheight/aspect + 0.5;
185                          xsiz = nlines*cheight;
186                          ysiz = (long)maxwidth*cwidth >> 8;
187 <                } else {
187 >                } else if (aspect > FTINY) {
188                          pictaspect = maxwidth/(256*nlines*aspect);
189                          if (pictaspect*xsiz < ysiz)
190                                  ysiz = pictaspect*xsiz + 0.5;
191                          else
192                                  xsiz = ysiz/pictaspect + 0.5;
193 +                        cheight = xsiz/nlines;
194 +                        cwidth = cheight/aspect + 0.5;
195 +                } else {
196 +                        pictaspect = (double)ysiz/xsiz;
197 +                        aspect = maxwidth/(256*nlines*pictaspect);
198                          cheight = xsiz/nlines;
199                          cwidth = cheight/aspect + 0.5;
200                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines