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-12 18:49:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-12 18:49:08 +0400
commit47f319eb6e386e5f03c09de4eafe0c2fe4574407 (patch)
tree52c4dc4e5a6497e788c0188f574bcbab478e8de7
parente81df3a6fa158a5aba3e22b357b44f512f728f88 (diff)
text editor, only draw line highlight when its in the view.
-rw-r--r--source/blender/editors/space_text/text_draw.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 6fbfc463c45..a8335399a50 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -1102,17 +1102,19 @@ 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(!(y<0 || y > ar->winy)) { /* check we need to draw */
+ 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-4, y, x2, y-st->lheight+1);
+ glDisable(GL_BLEND);
+ }
}
if(!hidden) {