billboards were using un-initialized memory and avoid divide by zero in some cases.
This commit is contained in:
@@ -1137,6 +1137,9 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
|
||||
int point_vel = (point && point->keys->vel);
|
||||
float real_t, dfra, keytime;
|
||||
|
||||
/* billboards wont fill in all of these, so start cleared */
|
||||
memset(keys, 0, sizeof(keys));
|
||||
|
||||
/* interpret timing and find keys */
|
||||
if(point) {
|
||||
if(result->time < 0.0f)
|
||||
|
||||
@@ -1389,6 +1389,7 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short
|
||||
/* scroller 'button' extents */
|
||||
totsize= v2d->tot.xmax - v2d->tot.xmin;
|
||||
scrollsize= (float)(hor.xmax - hor.xmin);
|
||||
if(totsize==0.0f) totsize = 1.0f; /* avoid divide by zero */
|
||||
|
||||
fac1= (v2d->cur.xmin - v2d->tot.xmin) / totsize;
|
||||
if(fac1<=0.0f)
|
||||
@@ -1429,6 +1430,7 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short
|
||||
/* scroller 'button' extents */
|
||||
totsize= v2d->tot.ymax - v2d->tot.ymin;
|
||||
scrollsize= (float)(vert.ymax - vert.ymin);
|
||||
if(totsize==0.0f) totsize = 1.0f; /* avoid divide by zero */
|
||||
|
||||
fac1= (v2d->cur.ymin- v2d->tot.ymin) / totsize;
|
||||
if(fac1<=0.0f)
|
||||
|
||||
Reference in New Issue
Block a user