GPencil: Remove Leak Size

This value was used to close gaps, but now with the new system is not needed.

Internally, still we need to keep a small leak size, but after doing a lot of test a 
value of 3 is perfect, so it's harcoded.
This commit is contained in:
Antonio Vazquez 2022-09-16 13:10:12 +02:00
parent 742268c50b
commit bdbf24772a
4 changed files with 3 additions and 12 deletions

View File

@ -982,7 +982,6 @@ void BKE_gpencil_brush_preset_set(Main *bmain, Brush *brush, const short type)
case GP_BRUSH_PRESET_FILL_AREA: {
brush->size = 5.0f;
brush->gpencil_settings->fill_leak = 3;
brush->gpencil_settings->fill_threshold = 0.1f;
brush->gpencil_settings->fill_simplylvl = 1;
brush->gpencil_settings->fill_factor = 1.0f;

View File

@ -67,6 +67,7 @@
#define LEAK_HORZ 0
#define LEAK_VERT 1
#define FILL_LEAK 3.0f
#define MIN_WINDOW_SIZE 128
/* Set to 1 to debug filling internal image. By default, the value must be 0. */
@ -1980,7 +1981,7 @@ static tGPDfill *gpencil_session_init_fill(bContext *C, wmOperator *op)
tgpf->fill_extend_fac = brush->gpencil_settings->fill_extend_fac;
tgpf->fill_factor = max_ff(GPENCIL_MIN_FILL_FAC,
min_ff(brush->gpencil_settings->fill_factor, GPENCIL_MAX_FILL_FAC));
tgpf->fill_leak = (int)ceil((float)brush->gpencil_settings->fill_leak * tgpf->fill_factor);
tgpf->fill_leak = (int)ceil(FILL_LEAK * tgpf->fill_factor);
int totcol = tgpf->ob->totcol;

View File

@ -58,8 +58,7 @@ typedef struct BrushGpencilSettings {
/** Factor for transparency. */
float fill_threshold;
/** Number of pixel to consider the leak is too small (x 2). */
short fill_leak;
char _pad2[2];
/* Type of caps: eGPDstroke_Caps. */
int8_t caps_type;
char _pad[5];

View File

@ -1491,14 +1491,6 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
/* fill leak size */
prop = RNA_def_property(srna, "fill_leak", PROP_INT, PROP_PIXEL);
RNA_def_property_int_sdna(prop, NULL, "fill_leak");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Leak Size", "Size in pixels to consider the leak closed");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
/* fill factor size */
prop = RNA_def_property(srna, "fill_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fill_factor");