Fixes for font underline

- underline faces had flipped winding by default.
- BKE_vfont_to_curve_ex disallowed 0 underline height (annoying when sliding value)
- disallow negative underline height since it flips underline direction (just change position + height)
This commit is contained in:
Campbell Barton
2014-05-15 16:00:53 +10:00
parent 2eeab8f191
commit c7ab68f1c4
2 changed files with 5 additions and 8 deletions

View File

@@ -312,10 +312,10 @@ static void build_underline(Curve *cu, ListBase *nubase, const rctf *rect,
bp = (BPoint *)MEM_callocN(4 * sizeof(BPoint), "underline_bp");
copy_v4_fl4(bp[0].vec, rect->xmin, (rect->ymin + yofs), 0.0f, 1.0f);
copy_v4_fl4(bp[1].vec, rect->xmax, (rect->ymin + yofs), 0.0f, 1.0f);
copy_v4_fl4(bp[2].vec, rect->xmax, (rect->ymax + yofs), 0.0f, 1.0f);
copy_v4_fl4(bp[3].vec, rect->xmin, (rect->ymax + yofs), 0.0f, 1.0f);
copy_v4_fl4(bp[0].vec, rect->xmin, (rect->ymax + yofs), 0.0f, 1.0f);
copy_v4_fl4(bp[1].vec, rect->xmax, (rect->ymax + yofs), 0.0f, 1.0f);
copy_v4_fl4(bp[2].vec, rect->xmax, (rect->ymin + yofs), 0.0f, 1.0f);
copy_v4_fl4(bp[3].vec, rect->xmin, (rect->ymin + yofs), 0.0f, 1.0f);
nu2->bp = bp;
BLI_addtail(nubase, nu2);
@@ -556,9 +556,6 @@ bool BKE_vfont_to_curve_ex(Main *bmain, Object *ob, int mode, ListBase *r_nubase
/* The VFont Data can not be found */
if (!vfd) return ok;
if (cu->ulheight == 0.0f)
cu->ulheight = 0.05f;
if (ef) {
slen = ef->len;

View File

@@ -1021,7 +1021,7 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna)
prop = RNA_def_property(srna, "underline_height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ulheight");
RNA_def_property_range(prop, -0.2f, 0.8f);
RNA_def_property_range(prop, 0.0f, 0.8f);
RNA_def_property_ui_text(prop, "Underline Thickness", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");