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>2012-12-31 18:49:27 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-31 18:49:27 +0400
commitacc05db50faa7323e32bab988b2f28e1bb05bc51 (patch)
treeb0011d670f778c243ff81cf7d455ef298b1b0233 /source/blender/editors/space_text
parent334ca1d344123f4d8f54c16cf93dab9f2fdae88f (diff)
minor updates to text autocomplete api
- draw function wasn't lining up correctly since DPI edits - rename text_python.c to text_autocomplete.c
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r--source/blender/editors/space_text/CMakeLists.txt2
-rw-r--r--source/blender/editors/space_text/text_autocomplete.c (renamed from source/blender/editors/space_text/text_python.c)10
-rw-r--r--source/blender/editors/space_text/text_draw.c4
3 files changed, 5 insertions, 11 deletions
diff --git a/source/blender/editors/space_text/CMakeLists.txt b/source/blender/editors/space_text/CMakeLists.txt
index b9e4e2f0afa..a33a9abada1 100644
--- a/source/blender/editors/space_text/CMakeLists.txt
+++ b/source/blender/editors/space_text/CMakeLists.txt
@@ -36,13 +36,13 @@ set(INC_SYS
set(SRC
space_text.c
+ text_autocomplete.c
text_draw.c
text_format.c
text_format_osl.c
text_format_py.c
text_header.c
text_ops.c
- text_python.c
text_format.h
text_intern.h
diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_autocomplete.c
index 1201302dad0..044c5322f23 100644
--- a/source/blender/editors/space_text/text_python.c
+++ b/source/blender/editors/space_text/text_autocomplete.c
@@ -122,7 +122,7 @@ void text_pop_suggest_list(void)
static void get_suggest_prefix(Text *text, int offset)
{
int i, len;
- char *line, tmp[256];
+ char *line;
if (!text) return;
if (!texttool_text_is_active(text)) return;
@@ -133,13 +133,7 @@ static void get_suggest_prefix(Text *text, int offset)
break;
i++;
len = text->curc - i + offset;
- if (len > 255) {
- printf("Suggestion prefix too long\n");
- len = 255;
- }
- BLI_strncpy(tmp, line + i, len);
- tmp[len] = '\0';
- texttool_suggest_prefix(tmp);
+ texttool_suggest_prefix(line + i, len);
}
static void confirm_suggestion(Text *text, int skipleft)
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 11a5687915b..6e33fc122b5 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -894,7 +894,7 @@ static void draw_documentation(SpaceText *st, ARegion *ar)
/* top = */ /* UNUSED */ y = ar->winy - st->lheight_dpi * l - 2;
boxw = DOC_WIDTH * st->cwidth + 20;
- boxh = (DOC_HEIGHT + 1) * st->lheight_dpi;
+ boxh = (DOC_HEIGHT + 1) * (st->lheight_dpi + TXT_LINE_SPACING);
/* Draw panel */
UI_ThemeColor(TH_BACK);
@@ -981,7 +981,7 @@ static void draw_suggestion_list(SpaceText *st, ARegion *ar)
else {
x = st->cwidth * (st->text->curc - st->left) + TXT_OFFSET - 4;
}
- y = ar->winy - st->lheight_dpi * l - 2;
+ y = ar->winy - (st->lheight_dpi + TXT_LINE_SPACING) * l - 2;
boxw = SUGG_LIST_WIDTH * st->cwidth + 20;
boxh = SUGG_LIST_SIZE * st->lheight_dpi + 8;