diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-02-08 00:40:01 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-02-11 02:39:17 +0300 |
commit | 5b10a6bb8e0d2b494abe784f71436adc118f6972 (patch) | |
tree | e7d4ccc5571266251e5c4456c5e90cfe29ce458d /source | |
parent | b4a01e7f4fde191516a6187d781ebdce45cf48b7 (diff) |
OpenGL immediate mode: fix Waveform Font color
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenfont/BLF_api.h | 1 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 649ec9c5a4b..1b967f889c0 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -70,6 +70,7 @@ void BLF_color4ubv(int fontid, const unsigned char rgba[4]); void BLF_color3ubv(int fontid, const unsigned char rgb[3]); void BLF_color3ubv_alpha(int fontid, const unsigned char rgb[3], unsigned char alpha); void BLF_color3ub(int fontid, unsigned char r, unsigned char g, unsigned char b); +void BLF_color4f(int fontid, float r, float g, float b, float a); void BLF_color4fv(int fontid, const float rgba[4]); void BLF_color3f(int fontid, float r, float g, float b); void BLF_color3fv_alpha(int fontid, const float rgb[3], float alpha); diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 7133c340617..ab7c831f95c 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -503,6 +503,12 @@ void BLF_color4fv(int fontid, const float rgba[4]) } } +void BLF_color4f(int fontid, float r, float g, float b, float a) +{ + float rgba[4] = { r, g, b, a }; + BLF_color4fv(fontid, rgba); +} + void BLF_color3fv_alpha(int fontid, const float rgb[3], float alpha) { float rgba[4]; diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 32df2aaebbd..1cd1921d124 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -764,8 +764,10 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), /* draw scale numbers first before binding any shader */ for (int i = 0; i < 6; i++) { char str[4]; + const int font_id = BLF_default(); BLI_snprintf(str, sizeof(str), "%-3d", i * 20); str[3] = '\0'; + BLF_color4f(font_id, 1.f, 1.f, 1.f, 0.08f); BLF_draw_default(rect.xmin + 1, yofs - 5 + (i / 5.f) * h, 0, str, sizeof(str) - 1); } |