Fix #125895: Brush invert setting was not taken into account for fill

Both the operator and the brush have an "invert" setting for the fill
tool. The operator property is toggled by both editor keymap and modal
keymap, while the brush setting is toggled from UI. Both settings are
combined (i.e. inverting both works like regular fill again).

Pull Request: https://projects.blender.org/blender/blender/pulls/126042
This commit is contained in:
Lukas Tönne
2024-08-08 11:29:05 +02:00
parent de10f8513c
commit 477d520376

View File

@@ -532,10 +532,13 @@ struct GreasePencilFillOpData {
const float extension_length = brush.gpencil_settings->fill_extend_fac *
bke::greasepencil::LEGACY_RADIUS_CONVERSION_FACTOR;
const bool extension_cut = brush.gpencil_settings->flag & GP_BRUSH_FILL_STROKE_COLLIDE;
const bool brush_invert = brush.gpencil_settings->fill_direction == BRUSH_DIR_IN;
/* Both operator properties and brush properties can invert. Actual invert is XOR of both. */
const bool combined_invert = (invert != brush_invert);
return {layer,
material_index,
invert,
combined_invert,
precision,
extension_mode,
extension_length,