Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-03 10:04:42 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-03 10:08:23 +0400
commit15bc30f4ee49c69f3ed6f92701a0f5cd52d306c5 (patch)
treefc77fe7096673256d90c512267adb58eb53c23de /source/blender/blenkernel/BKE_font.h
parenta5cb2229abbc7d43f34dabea332afd33614fc0db (diff)
Text3d: store number of characters and utf8 length separately
EditFont's use of Curve.len was very confusing, in editmode it represented the number of characters, in object mode the number of bytes. add Curve.len_wchar and keep track of both. Also don't convert the editmode text into utf8 on every keystroke. Now this is done on exiting editmode or save - to match most other object types. This also fixes curves 'body_format' being reported with an invalid size.
Diffstat (limited to 'source/blender/blenkernel/BKE_font.h')
-rw-r--r--source/blender/blenkernel/BKE_font.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_font.h b/source/blender/blenkernel/BKE_font.h
index 76fc7350d19..16cbcde0167 100644
--- a/source/blender/blenkernel/BKE_font.h
+++ b/source/blender/blenkernel/BKE_font.h
@@ -65,6 +65,11 @@ typedef struct EditFont {
struct CharInfo *textbufinfo;
float textcurs[4][2];
+
+ /* positional vars relative to the textbuf, textbufinfo (not utf8 bytes)
+ * a copy of these is kept in Curve, but use these in editmode */
+ int len, pos;
+ int selstart, selend;
} EditFont;
@@ -80,7 +85,7 @@ struct VFont *BKE_vfont_load(struct Main *bmain, const char *name);
bool BKE_vfont_to_curve(struct Main *bmain, struct Scene *scene, struct Object *ob, int mode,
struct CharTrans **r_chartransdata);
-int BKE_vfont_select_get(struct Object *ob, int *start, int *end);
+int BKE_vfont_select_get(struct Object *ob, int *r_start, int *r_end);
#ifdef __cplusplus
}