Merged changes in the trunk up to revision 43881.
[blender.git] / source / blender / editors / space_view3d / drawobject.c
index 1b94c9152b884f4f4fe13e7d9991fe9706997478..8fc2f17fae402714ab37bfc1f4497e41e61248b1 100644 (file)
@@ -4068,7 +4068,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
        ParticleDrawData *pdd = psys->pdd;
        Material *ma;
        float vel[3], imat[4][4];
-       float timestep, pixsize=1.0, pa_size, r_tilt, r_length;
+       float timestep, pixsize_scale, pa_size, r_tilt, r_length;
        float pa_time, pa_birthtime, pa_dietime, pa_health, intensity;
        float cfra;
        float ma_col[3]= {0.0f, 0.0f, 0.0f};
@@ -4175,12 +4175,11 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
                case PART_DRAW_CROSS:
                case PART_DRAW_AXIS:
                        /* lets calculate the scale: */
-                       pixsize= ED_view3d_pixel_size(rv3d, ob->obmat[3]);
                        
-                       if(part->draw_size==0.0)
-                               pixsize *= 2.0f;
+                       if (part->draw_size == 0.0)
+                               pixsize_scale = 2.0f;
                        else
-                               pixsize*=part->draw_size;
+                               pixsize_scale = part->draw_size;
 
                        if(draw_as==PART_DRAW_AXIS)
                                create_cdata = 1;
@@ -4368,6 +4367,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
 
                                ct+=dt;
                                for(i=0; i < trail_count; i++, ct += dt) {
+                                       float pixsize;
+
                                        if(part->draw & PART_ABS_PATH_TIME) {
                                                if(ct < pa_birthtime || ct > pa_dietime)
                                                        continue;
@@ -4401,6 +4402,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
                                                bb.time = ct;
                                        }
 
+                                       pixsize = ED_view3d_pixel_size(rv3d, state.co) * pixsize_scale;
+
                                        draw_particle(&state, draw_as, part->draw, pixsize, imat, part->draw_line, &bb, psys->pdd);
 
                                        totpoint++;
@@ -4411,6 +4414,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
                        {
                                state.time=cfra;
                                if(psys_get_particle_state(&sim,a,&state,0)){
+                                       float pixsize;
+
                                        if(psys->parent)
                                                mul_m4_v3(psys->parent->obmat, state.co);
 
@@ -4434,6 +4439,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
                                                bb.time = pa_time;
                                        }
 
+                                       pixsize = ED_view3d_pixel_size(rv3d, state.co) * pixsize_scale;
+
                                        draw_particle(&state, draw_as, part->draw, pixsize, imat, part->draw_line, &bb, pdd);
 
                                        totpoint++;