Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-18 16:35:30 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-18 16:35:30 +0300
commitbe819013174ad5c0978b9575b251ec2ec4003d4e (patch)
tree4ac193d7f6a876639e323fb8e36ee672c38061a7 /source/blender/editors/physics
parent50544ea6457fb1a05eedd184251e33956deab03f (diff)
Fix #20401: hair combing with limit selection to visible does not comb
all particles.
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r--source/blender/editors/physics/particle_edit.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index ac986ba7df6..8bacad3c132 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -373,7 +373,6 @@ static void PE_set_view3d_data(bContext *C, PEData *data)
static int key_test_depth(PEData *data, float co[3])
{
View3D *v3d= data->vc.v3d;
- RegionView3D *rv3d= data->vc.rv3d;
double ux, uy, uz;
float depth;
short wco[3], x,y;
@@ -393,26 +392,16 @@ static int key_test_depth(PEData *data, float co[3])
x=wco[0];
y=wco[1];
- // XXX verify ..
+ x+= (short)data->vc.ar->winrct.xmin;
+ y+= (short)data->vc.ar->winrct.ymin;
- if(rv3d->depths && x<rv3d->depths->w && y<rv3d->depths->h) {
- /* the 0.0001 is an experimental threshold to make selecting keys right next to a surface work better */
- if((float)uz - 0.0001 > rv3d->depths->depths[y*rv3d->depths->w+x])
- return 0;
- else
- return 1;
- }
- else {
- x+= (short)data->vc.ar->winrct.xmin;
- y+= (short)data->vc.ar->winrct.ymin;
+ view3d_validate_backbuf(&data->vc);
+ glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
- glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
-
- if((float)uz - 0.0001 > depth)
- return 0;
- else
- return 1;
- }
+ if((float)uz - 0.0001 > depth)
+ return 0;
+ else
+ return 1;
}
static int key_inside_circle(PEData *data, float rad, float co[3], float *distance)