diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-03 10:04:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-03 10:08:23 +0400 |
commit | 15bc30f4ee49c69f3ed6f92701a0f5cd52d306c5 (patch) | |
tree | fc77fe7096673256d90c512267adb58eb53c23de /source/blender/makesdna/DNA_curve_types.h | |
parent | a5cb2229abbc7d43f34dabea332afd33614fc0db (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/makesdna/DNA_curve_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_curve_types.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 24035464259..ad6a3a77413 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -216,15 +216,25 @@ typedef struct Curve { * - strlen(cu->str) object-mode (bytes). * - BLI_strlen_utf8(cu->str) in edit-mode. * This should be cleaned up and some point, see 'write_curves' - campbell */ - short len, lines, pos, spacemode; + short lines; + char spacemode, pad1; float spacing, linedist, shear, fsize, wordspace, ulpos, ulheight; float xof, yof; float linewidth; + int pad3; + int len_wchar; /* number of characters (strinfo) */ + int len; /* number of bytes (str - utf8) */ char *str; struct SelBox *selboxes; /* runtime variable for drawing selections (editmode data) */ struct EditFont *editfont; + /* copy of EditFont vars (wchar_t aligned), + * warning! don't use in editmode (storage only) */ + int pos; + int selstart, selend; + int pad2; + char family[24]; struct VFont *vfont; struct VFont *vfontb; @@ -237,8 +247,6 @@ typedef struct Curve { int totbox, actbox; struct TextBox *tb; - int selstart, selend; - struct CharInfo *strinfo; struct CharInfo curinfo; |