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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-11-20 16:10:54 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-11-20 16:10:54 +0400
commit7c05359b66a5326aaab9747d3f5aaecb527bb2df (patch)
tree9f5293ea0ee928ef9d5b530d6264db716ddeded8 /source/blender/editors/space_text/text_draw.c
parent713ee0f2e0d6bcbfce36efb7d9ce3f41045d1e25 (diff)
Text editor: fix for line spacing with word wrap enabled
Diffstat (limited to 'source/blender/editors/space_text/text_draw.c')
-rw-r--r--source/blender/editors/space_text/text_draw.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 76908e5b369..423452e207b 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -734,7 +734,7 @@ static int text_draw_wrapped(SpaceText *st, const char *str, int x, int y, int w
if (st->showsyntax && format) format_draw_color(format[a]);
x += text_font_draw_character_utf8(st, x, y, str + ma);
}
- y -= st->lheight;
+ y -= st->lheight + TXT_LINE_SPACING;
x = basex;
lines++;
start = end; mstart = mend;
@@ -1834,16 +1834,14 @@ void draw_text_main(SpaceText *st, ARegion *ar)
if (st->wordwrap) {
/* draw word wrapped text */
int lines = text_draw_wrapped(st, tmp->line, x, y, winx - x, tmp->format, wrap_skip);
- y -= lines * st->lheight;
+ y -= lines * (st->lheight + TXT_LINE_SPACING);
}
else {
/* draw unwrapped text */
text_draw(st, tmp->line, st->left, ar->winx / st->cwidth, 1, x, y, tmp->format);
- y -= st->lheight;
+ y -= st->lheight + TXT_LINE_SPACING;
}
- y-= TXT_LINE_SPACING;
-
wrap_skip = 0;
}