[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31290] trunk/blender/source/blender/ editors/space_text/text_draw.c: text editor, only draw line highlight when its in the view.
Campbell Barton
ideasman42 at gmail.com
Thu Aug 12 16:49:09 CEST 2010
Revision: 31290
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31290
Author: campbellbarton
Date: 2010-08-12 16:49:08 +0200 (Thu, 12 Aug 2010)
Log Message:
-----------
text editor, only draw line highlight when its in the view.
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_text/text_draw.c
Modified: trunk/blender/source/blender/editors/space_text/text_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_text/text_draw.c 2010-08-12 14:02:38 UTC (rev 31289)
+++ trunk/blender/source/blender/editors/space_text/text_draw.c 2010-08-12 14:49:08 UTC (rev 31290)
@@ -1102,17 +1102,19 @@
}
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) {
More information about the Bf-blender-cvs
mailing list