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:
authorJohnny Matthews <johnny.matthews@gmail.com>2005-02-25 20:48:06 +0300
committerJohnny Matthews <johnny.matthews@gmail.com>2005-02-25 20:48:06 +0300
commitbca210bc04ca74beb658e1a261b65d095235f503 (patch)
tree2aabed31a53e0dbe4511c9727e407152a6e57971 /source/blender/src/editfont.c
parentb334be110d0fc92f27e1bbae1e17675b14d45e57 (diff)
Update on Add Text as lines:
Spaces lines based on view -tnx Kaito for inverse help cleaned up code added undo
Diffstat (limited to 'source/blender/src/editfont.c')
-rw-r--r--source/blender/src/editfont.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/source/blender/src/editfont.c b/source/blender/src/editfont.c
index 2c5be982b7a..99cf13d46f8 100644
--- a/source/blender/src/editfont.c
+++ b/source/blender/src/editfont.c
@@ -43,9 +43,12 @@
#include <io.h>
#endif
+#include "MTC_matrixops.h"
+
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
#include "DNA_curve_types.h"
#include "DNA_object_types.h"
@@ -317,9 +320,10 @@ void txt_export_to_objects(struct Text *text)
{
ID *id;
Curve *cu;
- struct TextLine *tmp, *curline;
+ struct TextLine *curline;
int nchars;
- int linNum = 0;
+ int linenum = 0;
+ float offset[3] = {0.0,0.0,0.0};
if(!text) return;
@@ -332,27 +336,30 @@ void txt_export_to_objects(struct Text *text)
while(curline){
/*skip lines with no text, but still make space for them*/
if(curline->line[0] == '\0'){
- linNum++;
+ linenum++;
curline = curline->next;
continue;
}
-
nchars = 0;
add_object(OB_FONT);
base_init_from_view3d(BASACT, G.vd);
G.obedit= BASACT->object;
- where_is_object(G.obedit);
-
+ where_is_object(G.obedit);
/* Do the translation */
-
- G.obedit->loc[1] -= linNum;
+ offset[0] = 0;
+ offset[1] = -linenum;
+ offset[2] = 0;
- /* End Translation */
+ Mat4Mul3Vecfl(G.vd->viewinv,offset);
-
+ G.obedit->loc[0] += offset[0];
+ G.obedit->loc[1] += offset[1];
+ G.obedit->loc[2] += offset[2];
+ /* End Translation */
+
cu= G.obedit->data;
cu->vfont= get_builtin_font();
@@ -368,13 +375,13 @@ void txt_export_to_objects(struct Text *text)
cu->len= strlen(curline->line);
cu->pos= cu->len;
-
make_editText();
exit_editmode(1);
- linNum++;
+ linenum++;
curline = curline->next;
}
+ BIF_undo_push("Add Text as Objects");
allqueue(REDRAWVIEW3D, 0);
}