Fix T103764: Grease Pencil modes other than Draw use a wrong radial

It was introduced in commit https://developer.blender.org/rB0fb12a9c2ebc

The problem was that the tool uses the same values for all modes,
but the new calculation must be only for Draw mode.

Now the mode is checked.
This commit is contained in:
Antonio Vazquez 2023-01-10 17:00:43 +01:00
parent 9b8c2f91f6
commit db688b62f9
Notes: blender-bot 2023-02-13 23:16:02 +01:00
Referenced by issue #103764, Regression: Grease Pencil modes other than Draw use a wrong radial size operator
1 changed files with 2 additions and 1 deletions

View File

@ -1786,7 +1786,8 @@ float ED_gpencil_radial_control_scale(struct bContext *C,
const int mval[2])
{
float scale_fac = 1.0f;
if ((brush && brush->gpencil_settings) && (brush->gpencil_tool == GPAINT_TOOL_DRAW)) {
if ((brush && brush->gpencil_settings) && (brush->ob_mode == OB_MODE_PAINT_GPENCIL) &&
(brush->gpencil_tool == GPAINT_TOOL_DRAW)) {
float cursor_radius = ED_gpencil_cursor_radius(C, mval[0], mval[1]);
scale_fac = max_ff(cursor_radius, 1.0f) / max_ff(initial_value, 1.0f);
}