Fix T87131: SVG as GPencil elements with both Stroke and Fill fails

The importer was not checking if both were enabled. Now a new material is created if it's needed.
This commit is contained in:
Antonio Vazquez
2021-04-02 13:45:51 +02:00
parent 548d16d4a5
commit e7a0a75919

View File

@@ -118,15 +118,17 @@ bool GpencilImporterSVG::read()
}
/* Create_shape materials. */
const char *const mat_names[] = {"Stroke", "Fill"};
const char *const mat_names[] = {"Stroke", "Fill", "Both"};
int index = 0;
if ((is_stroke) && (is_fill)) {
if ((is_stroke) && (!is_fill)) {
index = 0;
is_fill = false;
}
else if ((!is_stroke) && (is_fill)) {
index = 1;
}
else if ((is_stroke) && (is_fill)) {
index = 2;
}
int32_t mat_index = create_material(mat_names[index], is_stroke, is_fill);
/* Loop all paths to create the stroke data. */