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>2010-08-11 09:21:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-11 09:21:43 +0400
commitd739a1788d338795039530c2d6503b93ab805161 (patch)
treedff0da4b00dfa597811ea531527ea735ca496067 /source/blender/editors/space_text/text_draw.c
parent8c393269622bf250ec9b0fbd3e689b534ad1e1ec (diff)
small edits to text editor from writing a python editor extension.
- rename TextLine.line -> body, ConsoleLine.line -> body - minor speedups when setting the body text, also re-allocate console lines if they are < half the length. - added option to highlight current line in the text editor.
Diffstat (limited to 'source/blender/editors/space_text/text_draw.c')
-rw-r--r--source/blender/editors/space_text/text_draw.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 926ccc1914a..6fbfc463c45 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -1101,6 +1101,20 @@ static void draw_cursor(SpaceText *st, ARegion *ar)
}
}
+ if(st->line_hlight) {
+ /* TODO, dont draw if hidden */
+ int x1= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+ int x2= x1 + ar->winx;
+ y= ar->winy-2 - vsell*st->lheight;
+
+ glColor4ub(255, 255, 255, 32);
+
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
+ glRecti(x1, y, x2, y-st->lheight+1);
+ glDisable(GL_BLEND);
+ }
+
if(!hidden) {
/* Draw the cursor itself (we draw the sel. cursor as this is the leading edge) */
x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
@@ -1288,7 +1302,7 @@ void draw_text_main(SpaceText *st, ARegion *ar)
}
y= ar->winy-st->lheight;
winx= ar->winx - TXT_SCROLL_WIDTH;
-
+
/* draw cursor */
draw_cursor(st, ar);