| 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; |
| 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 |
|
} |