[#18439] Controlling the bevel shape for a text object with a curve no longer works.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 31 Mar 2009 06:22:25 +0000 (06:22 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 31 Mar 2009 06:22:25 +0000 (06:22 +0000)
own fault, broke rev16702.
Curves created by fonts didnt have their radius set. Forgot do do this when making radius calculated with the curve (like tilt)

source/blender/blenkernel/BKE_curve.h
source/blender/blenkernel/intern/curve.c
source/blender/blenlib/intern/freetypefont.c
source/blender/blenlib/intern/psfont.c

index a66199587976d5fad1f0b65b0a69426b5b78418a..a8d4ece7a2180092a12b6859a81a0bc23abeaedc 100644 (file)
@@ -46,6 +46,10 @@ struct BevList;
 #define SEGMENTSU(nu)      ( ((nu)->flagu & CU_CYCLIC) ? (nu)->pntsu : (nu)->pntsu-1 )
 #define SEGMENTSV(nu)      ( ((nu)->flagv & CU_CYCLIC) ? (nu)->pntsv : (nu)->pntsv-1 )
 
+#define CU_DO_TILT(cu, nu) (((nu->type & CU_2D) && (cu->flag & CU_3D)==0) ? 0 : 1)
+#define CU_DO_RADIUS(cu, nu) ((CU_DO_TILT(cu, nu) || cu->bevobj) ? 1:0)
+
+
 void unlink_curve( struct Curve *cu);
 void free_curve( struct Curve *cu);
 struct Curve *add_curve(char *name, int type);
index e303f78b16368db81021e90b51d8b3f9251a6c7d..0d6382a8d37e21d9e04660360717f27ccb697a18 100644 (file)
@@ -1535,8 +1535,8 @@ void makeBevelList(Object *ob)
        while(nu) {
                
                /* check if we will calculate tilt data */
-               do_tilt = ((nu->type & CU_2D) && (cu->flag & CU_3D)==0) ? 0 : 1;
-               do_radius = (do_tilt || cu->bevobj) ? 1 : 0; /* normal display uses the radius, better just to calculate them */
+               do_tilt = CU_DO_TILT(cu, nu);
+               do_radius = CU_DO_RADIUS(cu, nu); /* normal display uses the radius, better just to calculate them */
                
                /* check we are a single point? also check we are not a surface and that the orderu is sane,
                 * enforced in the UI but can go wrong possibly */
index 48a40db6a72e1849d013ad4103e35b0eaf21a5b4..a97f2460ba17552ebde2b8d016b40cc2a80dd6e8 100644 (file)
@@ -178,6 +178,7 @@ void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vfd)
                                                bezt->vec[2][1] = (dy + (2 * ftoutline.points[l+1].y)* scale) / 3.0;
 
                                                bezt->h1= bezt->h2= HD_ALIGN;
+                                               bezt->radius= 1.0f;
                                                bezt++;
                                        }
                                }
@@ -264,6 +265,7 @@ void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vfd)
                                        {
                                                bezt->h1= bezt->h2= HD_ALIGN;
                                        }
+                                       bezt->radius= 1.0f;
                                        bezt++;
                                }
                        }
index 54d7f8ec1af5fcb61f7e824d5d83feb36252cdc4..39d38e4cf3af1f8b234e14ecbece852370441378 100644 (file)
@@ -2094,6 +2094,7 @@ static VFontData *objfnt_to_vfontdata(objfnt *fnt)
                                                while(a--) {
                                                        if(bezt->h1!=HD_ALIGN && bezt->h2==HD_ALIGN) bezt->h2= 0;
                                                        else if(bezt->h2!=HD_ALIGN && bezt->h1==HD_ALIGN) bezt->h1= 0;
+                                                       bezt->radius= 1.0f;
                                                        bezt++;
                                                }