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-10-09 10:15:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-09 10:15:07 +0400
commitf45acb2bba96341bce7b49cf72bcbd8bbaaafe80 (patch)
tree1fd39713ffc73625f703130225ae3fa7900cfaec /source/blender/editors/space_text
parentb1c4809f505e2ff4249b1c12c0efb2930a4d94ce (diff)
patch [#31709] Text editor: scroll margin column along with text
by Sebastian Nell (codemanx) The margin ignored horizontal scrolling.
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r--source/blender/editors/space_text/text_draw.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 5111d20b8ee..a68524fcdd6 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -1741,6 +1741,7 @@ void draw_text_main(SpaceText *st, ARegion *ar)
char linenr[12];
int i, x, y, winx, linecount = 0, lineno = 0;
int wraplinecount = 0, wrap_skip = 0;
+ int margin_column_x;
if (st->lheight) st->viewlines = (int)ar->winy / st->lheight;
else st->viewlines = 0;
@@ -1845,10 +1846,14 @@ void draw_text_main(SpaceText *st, ARegion *ar)
if (st->flags & ST_SHOW_MARGIN) {
UI_ThemeColor(TH_HILITE);
- glBegin(GL_LINES);
- glVertex2i(x + st->cwidth * st->margin_column, 0);
- glVertex2i(x + st->cwidth * st->margin_column, ar->winy - 2);
- glEnd();
+ margin_column_x = x + st->cwidth * (st->margin_column - st->left);
+
+ if (margin_column_x >= x) {
+ glBegin(GL_LINES);
+ glVertex2i(margin_column_x, 0);
+ glVertex2i(margin_column_x, ar->winy - 2);
+ glEnd();
+ }
}
/* draw other stuff */