UI: Fix waveform widget text drawing.

Flush the text cache so that we have proper scissor test and ordering.
This commit is contained in:
2018-04-07 14:03:32 +02:00
parent 2d618974d1
commit 1a33707417
3 changed files with 14 additions and 0 deletions

View File

@@ -910,6 +910,9 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
}
}
/* Flush text cache before changing scissors. */
BLF_batch_draw_flush();
glEnable(GL_BLEND);
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
@@ -934,6 +937,9 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
BLF_draw_default(rect.xmin + 1, yofs - 5 + (i * 0.2f) * h, 0, str, sizeof(str) - 1);
}
/* Flush text cache before drawing things on top. */
BLF_batch_draw_flush();
glEnable(GL_BLEND);
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);