204 |
|
if (nv != &odev.v) { |
205 |
|
if (!FEQ(nv->horiz,odev.v.horiz) || /* resize window? */ |
206 |
|
!FEQ(nv->vert,odev.v.vert)) { |
207 |
< |
odev.hres = 2.*VIEWDIST*tan(PI/180./2.*nv->horiz) / |
208 |
< |
pwidth; |
209 |
< |
odev.vres = 2.*VIEWDIST*tan(PI/180./2.*nv->vert) / |
210 |
< |
pheight; |
207 |
> |
odev.hres = 2.*VIEWDIST/pwidth * |
208 |
> |
tan(PI/180./2.*nv->horiz); |
209 |
> |
odev.vres = 2.*VIEWDIST/pheight * |
210 |
> |
tan(PI/180./2.*nv->vert); |
211 |
|
XResizeWindow(ourdisplay, gwind, odev.hres, odev.vres); |
212 |
|
} |
213 |
|
copystruct(&odev.v, nv); |
599 |
|
if (ersz->width == odev.hres && ersz->height == odev.vres) |
600 |
|
return; |
601 |
|
|
602 |
– |
if (odev.hres != 0 && odev.vres != 0) { |
603 |
– |
odev.v.horiz = 2.*180./PI * atan(0.5/VIEWDIST*pwidth*odev.hres); |
604 |
– |
odev.v.vert = 2.*180./PI * atan(0.5/VIEWDIST*pheight*odev.vres); |
605 |
– |
inpresflags |= DEV_NEWVIEW; |
606 |
– |
} |
602 |
|
odev.hres = ersz->width; |
603 |
|
odev.vres = ersz->height; |
604 |
|
|
605 |
< |
inpresflags |= DEV_NEWSIZE; |
605 |
> |
odev.v.horiz = 2.*180./PI * atan(0.5/VIEWDIST*pwidth*odev.hres); |
606 |
> |
odev.v.vert = 2.*180./PI * atan(0.5/VIEWDIST*pheight*odev.vres); |
607 |
> |
|
608 |
> |
inpresflags |= DEV_NEWSIZE|DEV_NEWVIEW; |
609 |
|
} |