Fix T80311: Sculpt Filters not working when using vertical split

All filters were using prevclicx, which is in screen coordinates and
mval[0], which is in region coordinates to get the filter strength.

This fixes the issue in all filters.

Reviewed By: Severin

Maniphest Tasks: T80311

Differential Revision: https://developer.blender.org/D8776
This commit is contained in:
Pablo Dobarro 2020-09-02 22:30:36 +02:00
parent ba4a2a4c8b
commit fb09bc3c35
Notes: blender-bot 2023-02-14 10:09:24 +01:00
Referenced by issue #80311, Cloth filter brush only works in one direction in vertically split viewport
3 changed files with 3 additions and 3 deletions

View File

@ -1241,7 +1241,7 @@ static int sculpt_cloth_filter_modal(bContext *C, wmOperator *op, const wmEvent
return OPERATOR_RUNNING_MODAL;
}
float len = event->prevclickx - event->mval[0];
const float len = event->prevclickx - event->x;
filter_strength = filter_strength * -len * 0.001f * UI_DPI_FAC;
SCULPT_vertex_random_access_ensure(ss);

View File

@ -228,7 +228,7 @@ static int sculpt_color_filter_modal(bContext *C, wmOperator *op, const wmEvent
return OPERATOR_RUNNING_MODAL;
}
float len = event->prevclickx - event->mval[0];
const float len = event->prevclickx - event->x;
filter_strength = filter_strength * -len * 0.001f;
float fill_color[3];

View File

@ -636,7 +636,7 @@ static int sculpt_mesh_filter_modal(bContext *C, wmOperator *op, const wmEvent *
return OPERATOR_RUNNING_MODAL;
}
float len = event->prevclickx - event->mval[0];
const float len = event->prevclickx - event->x;
filter_strength = filter_strength * -len * 0.001f * UI_DPI_FAC;
SCULPT_vertex_random_access_ensure(ss);