[Bf-blender-cvs] [c7ab68f] master: Fixes for font underline

Campbell Barton noreply at git.blender.org
Thu May 15 08:07:45 CEST 2014


Commit: c7ab68f1c4d02136bd70d4a17eaae4b78254db74
Author: Campbell Barton
Date:   Thu May 15 16:00:53 2014 +1000
https://developer.blender.org/rBc7ab68f1c4d02136bd70d4a17eaae4b78254db74

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)

===================================================================

M	source/blender/blenkernel/intern/font.c
M	source/blender/makesrna/intern/rna_curve.c

===================================================================

diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 5ae4180..637ae03 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -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;
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 142b4ed..79c19c4 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -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");




More information about the Bf-blender-cvs mailing list