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-05-15 13:06:25 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-05-15 13:06:25 +0400
commit42eb36ecf6e09b2d3801bf367d12e469b7322c00 (patch)
tree02e608211b1e374a6dbd40ee14a034f396a5ea8c /source/blender/editors/curve
parentc742a4b62b26b7878c122d8a204ccf0c2d934dde (diff)
Fix 3D font selection and material lagging behind with vertical cursor motion
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/editfont.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index bd13d383746..36e1210402d 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -247,8 +247,19 @@ static void text_update_edited(bContext *C, Object *obedit, int mode)
struct Main *bmain = CTX_data_main(C);
Curve *cu = obedit->data;
EditFont *ef = cu->editfont;
+
+ /* run update first since it can move the cursor */
+ if (mode == FO_EDIT) {
+ /* re-tesselllate */
+ DAG_id_tag_update(obedit->data, 0);
+ }
+ else {
+ /* depsgraph runs above, but since we're not tagging for update, call direct */
+ BKE_vfont_to_curve(bmain, obedit, mode);
+ }
+
cu->curinfo = ef->textbufinfo[ef->pos ? ef->pos - 1 : 0];
-
+
if (obedit->totcol > 0) {
obedit->actcol = cu->curinfo.mat_nr;
@@ -259,15 +270,6 @@ static void text_update_edited(bContext *C, Object *obedit, int mode)
}
}
- if (mode == FO_EDIT) {
- /* re-tesselllate */
- DAG_id_tag_update(obedit->data, 0);
- }
- else {
- /* depsgraph runs above, but since we're not tagging for update, call direct */
- BKE_vfont_to_curve(bmain, obedit, mode);
- }
-
WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
}
@@ -1056,6 +1058,14 @@ static int move_cursor(bContext *C, int type, const bool select)
else if (ef->pos >= MAXTEXT) ef->pos = MAXTEXT;
else if (ef->pos < 0) ef->pos = 0;
+ /* apply virtical cursor motion to position immediately
+ * otherwise the selection will lag behind */
+ if (FO_CURS_IS_MOTION(cursmove)) {
+ struct Main *bmain = CTX_data_main(C);
+ BKE_vfont_to_curve(bmain, obedit, cursmove);
+ cursmove = FO_CURS;
+ }
+
if (select == 0) {
if (ef->selstart) {
struct Main *bmain = CTX_data_main(C);