bugfix [#22794] Inconsistent behaviour with Panorama, border rendering

This commit is contained in:
Campbell Barton 2010-11-09 01:37:58 +00:00
parent c4967b5dde
commit 718df71864
2 changed files with 12 additions and 9 deletions

@ -1531,9 +1531,9 @@ static RenderPart *find_next_pano_slice(Render *re, int *minx, rctf *viewplane)
if(best) {
float phi= panorama_pixel_rot(re);
/* R.disprect.xmax - R.disprect.xmin rather then R.winx for border render */
R.panodxp= (re->winx - (best->disprect.xmin + best->disprect.xmax) )/2;
R.panodxv= ((viewplane->xmax-viewplane->xmin)*R.panodxp)/(float)R.winx;
R.panodxv= ((viewplane->xmax-viewplane->xmin)*R.panodxp)/(float)(R.disprect.xmax - R.disprect.xmin);
/* shift viewplane */
R.viewplane.xmin = viewplane->xmin + R.panodxv;
@ -2663,10 +2663,6 @@ int RE_is_rendering_allowed(Scene *scene, void *erh, void (*error)(void *handle,
/* forbidden combinations */
if(scene->r.mode & R_PANORAMA) {
if(scene->r.mode & R_BORDER) {
error(erh, "No border supported for Panorama");
return 0;
}
if(scene->r.mode & R_ORTHO) {
error(erh, "No Ortho render possible for Panorama");
return 0;

@ -96,8 +96,15 @@ void calc_view_vector(float *view, float x, float y)
}
else {
if(R.r.mode & R_PANORAMA)
if(R.r.mode & R_PANORAMA) {
if(R.r.mode & R_BORDER) {
/* scale by the win/border size */
x-= R.panodxp * ((float)R.winx / (float)(R.disprect.xmax - R.disprect.xmin));
}
else {
x-= R.panodxp;
}
}
/* move x and y to real viewplane coords */
x= (x/(float)R.winx);