From d527c669f7731ff71f8179a661f32fb1322cbe51 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Jul 2013 14:05:50 +0000 Subject: fix [#36176] Connected font Bevel moves inwards for some letter combinations bevel wasn't taking into account overlapping text (bug goes back to 1.8). --- source/blender/blenkernel/intern/curve.c | 21 ++++++++++++--------- source/blender/makesdna/DNA_curve_types.h | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 3b9fbbb1c4d..00a479b8b88 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2323,6 +2323,7 @@ void BKE_curve_bevelList_make(Object *ob) bl = MEM_callocN(sizeof(BevList) + 1 * sizeof(BevPoint), "makeBevelList1"); BLI_addtail(&(cu->bev), bl); bl->nr = 0; + bl->charidx = nu->charidx; } else { if (G.is_rendering && cu->resolu_ren != 0) @@ -2335,10 +2336,10 @@ void BKE_curve_bevelList_make(Object *ob) bl = MEM_callocN(sizeof(BevList) + len * sizeof(BevPoint), "makeBevelList2"); BLI_addtail(&(cu->bev), bl); - if (nu->flagu & CU_NURB_CYCLIC) bl->poly = 0; - else bl->poly = -1; + bl->poly = (nu->flagu & CU_NURB_CYCLIC) ? 0 : -1; bl->nr = len; bl->dupe_nr = 0; + bl->charidx = nu->charidx; bevp = (BevPoint *)(bl + 1); bp = nu->bp; @@ -2358,8 +2359,8 @@ void BKE_curve_bevelList_make(Object *ob) bl = MEM_callocN(sizeof(BevList) + len * sizeof(BevPoint), "makeBevelBPoints"); BLI_addtail(&(cu->bev), bl); - if (nu->flagu & CU_NURB_CYCLIC) bl->poly = 0; - else bl->poly = -1; + bl->poly = (nu->flagu & CU_NURB_CYCLIC) ? 0 : -1; + bl->charidx = nu->charidx; bevp = (BevPoint *)(bl + 1); a = nu->pntsu - 1; @@ -2445,8 +2446,8 @@ void BKE_curve_bevelList_make(Object *ob) BLI_addtail(&(cu->bev), bl); bl->nr = len; bl->dupe_nr = 0; - if (nu->flagu & CU_NURB_CYCLIC) bl->poly = 0; - else bl->poly = -1; + bl->poly = (nu->flagu & CU_NURB_CYCLIC) ? 0 : -1; + bl->charidx = nu->charidx; bevp = (BevPoint *)(bl + 1); BKE_nurb_makeCurve(nu, &bevp->vec[0], @@ -2572,9 +2573,11 @@ void BKE_curve_bevelList_make(Object *ob) bl = sd->bl; /* is bl a hole? */ sd1 = sortdata + (a - 1); for (b = a - 1; b >= 0; b--, sd1--) { /* all polys to the left */ - if (bevelinside(sd1->bl, bl)) { - bl->hole = 1 - sd1->bl->hole; - break; + if (sd1->bl->charidx == bl->charidx) { /* for text, only check matching char */ + if (bevelinside(sd1->bl, bl)) { + bl->hole = 1 - sd1->bl->hole; + break; + } } } } diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 964fa11b0a2..7ff8667f90e 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -75,6 +75,7 @@ typedef struct BevList { struct BevList *next, *prev; int nr, dupe_nr; int poly, hole; + int charidx; } BevList; /* These two Lines with # tell makesdna this struct can be excluded. */ -- cgit v1.2.3