diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-11 09:35:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-11 09:35:45 +0300 |
commit | 80a650dfb1e73363ae6924dc5738b732bb89ded4 (patch) | |
tree | 7d8af50bde3e4c32474d899a7fd00558afe9befc /source/blender/editors/interface | |
parent | 59cfe81085b06243220cdb075a28a1352edebf7b (diff) |
BLF_draw functions take an extra length argument, so the console drawing doenst need to swap in NULL chars to draw word wrapping.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d.c | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 29278edf451..1e818289d1e 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -856,7 +856,7 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), sprintf(str,"%-3d",i*20); str[3]='\0'; fdrawline(rect.xmin+22, yofs+(i/5.f)*h, rect.xmax+1, yofs+(i/5.f)*h); - BLF_draw_default(rect.xmin+1, yofs-5+(i/5.f)*h, 0, str); + BLF_draw_default(rect.xmin+1, yofs-5+(i/5.f)*h, 0, str, sizeof(str)-1); /* in the loop because blf_draw reset it */ glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index fda52e927af..719be6c3463 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -165,7 +165,7 @@ void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, char *str) if (fs->kerning == 1) BLF_enable(fs->uifont_id, BLF_KERNING_DEFAULT); - BLF_draw(fs->uifont_id, str); + BLF_draw(fs->uifont_id, str, 65535); /* XXX, use real length */ BLF_disable(fs->uifont_id, BLF_CLIPPING); if (fs->shadow) BLF_disable(fs->uifont_id, BLF_SHADOW); @@ -218,7 +218,7 @@ void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, char *str) if (fs->kerning == 1) BLF_enable(fs->uifont_id, BLF_KERNING_DEFAULT); - BLF_draw(fs->uifont_id, str); + BLF_draw(fs->uifont_id, str, 65535); /* XXX, use real length */ BLF_disable(fs->uifont_id, BLF_ROTATION); BLF_disable(fs->uifont_id, BLF_CLIPPING); if (fs->shadow) @@ -258,7 +258,7 @@ void UI_DrawString(float x, float y, char *str) uiStyleFontSet(&style->widget); BLF_position(style->widget.uifont_id, x, y, 0.0f); - BLF_draw(style->widget.uifont_id, str); + BLF_draw(style->widget.uifont_id, str, 65535); /* XXX, use real length */ if (style->widget.kerning == 1) BLF_disable(style->widget.uifont_id, BLF_KERNING_DEFAULT); diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index c1c10bf33c6..43d4e20b8bb 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1525,7 +1525,7 @@ static void scroll_printstr(Scene *scene, float x, float y, float val, int power } /* draw it */ - BLF_draw_default(x, y, 0.0f, str); + BLF_draw_default(x, y, 0.0f, str, sizeof(str)-1); } /* Draw scrollbars in the given 2d-region */ @@ -2054,7 +2054,7 @@ void UI_view2d_text_cache_draw(ARegion *ar) for(v2s= strings.first; v2s; v2s= v2s->next) { glColor3fv(v2s->col); if(v2s->rect.xmin==v2s->rect.xmax) - BLF_draw_default((float)v2s->mval[0], (float)v2s->mval[1], 0.0, v2s->str); + BLF_draw_default((float)v2s->mval[0], (float)v2s->mval[1], 0.0, v2s->str, sizeof(v2s->str)-1); else { int xofs=0, yofs; @@ -2063,7 +2063,7 @@ void UI_view2d_text_cache_draw(ARegion *ar) BLF_clipping_default(v2s->rect.xmin-4, v2s->rect.ymin-4, v2s->rect.xmax+4, v2s->rect.ymax+4); BLF_enable_default(BLF_CLIPPING); - BLF_draw_default(v2s->rect.xmin+xofs, v2s->rect.ymin+yofs, 0.0f, v2s->str); + BLF_draw_default(v2s->rect.xmin+xofs, v2s->rect.ymin+yofs, 0.0f, v2s->str, sizeof(v2s->str)-1); BLF_disable_default(BLF_CLIPPING); } } |