diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-07 10:02:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-07 10:02:47 +0300 |
commit | d620ff838053b58cc571913e6a1f68fa4f6a1d73 (patch) | |
tree | 9b1fa155a0dccfd476ad275d3572ee1019ee2040 /source/blender/editors/space_sequencer | |
parent | 612936954ac67cacee8d13f48ed1bd8b5ff386c7 (diff) |
2D text drawing
- with the NLA on a small strip text was drawn under the scroll bar, now draw with same alignment as rectangle constrained text.
- single alloc per text item.
- was using opengl context rather then passing color value.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 49d7e6a2f33..087b0b7dcd7 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -343,7 +343,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short dire } if(G.moving || (seq->flag & whichsel)) { - cpack(0xFFFFFF); + const char col[4]= {255, 255, 255, 255}; if (direction == SEQ_LEFTHANDLE) { sprintf(str, "%d", seq->startdisp); x1= rx1; @@ -353,7 +353,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short dire x1= x2 - handsize*0.75; y1= y2 + 0.05; } - UI_view2d_text_cache_add(v2d, x1, y1, str); + UI_view2d_text_cache_add(v2d, x1, y1, str, col); } } @@ -467,6 +467,7 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float rctf rect; char str[32 + FILE_MAXDIR+FILE_MAXFILE]; const char *name= seq->name+2; + char col[4]; if(name[0]=='\0') name= give_seqname(seq); @@ -511,18 +512,19 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float } if(seq->flag & SELECT){ - cpack(0xFFFFFF); + col[0]= col[1]= col[2]= 255; }else if ((((int)background_col[0] + (int)background_col[1] + (int)background_col[2]) / 3) < 50){ - cpack(0x505050); /* use lighter text color for dark background */ + col[0]= col[1]= col[2]= 80; /* use lighter text color for dark background */ }else{ - cpack(0); + col[0]= col[1]= col[2]= 0; } - + col[3]= 255; + rect.xmin= x1; rect.ymin= y1; rect.xmax= x2; rect.ymax= y2; - UI_view2d_text_cache_rectf(v2d, &rect, str); + UI_view2d_text_cache_rectf(v2d, &rect, str, col); } /* draws a shaded strip, made from gradient + flat color + gradient */ |