@@ -73,7 +73,7 @@ void MenuBase::Draw(NVGcontext* vg, Theme* theme) {
|
||||
if (fixed) { \
|
||||
start_x -= fixed; \
|
||||
} else { \
|
||||
gfx::textBounds(vg, 0, 0, bounds, __VA_ARGS__); \
|
||||
gfx::textBoundsArgs(vg, 0, 0, bounds, __VA_ARGS__); \
|
||||
start_x -= spacing + (bounds[2] - bounds[0]); \
|
||||
}
|
||||
|
||||
|
||||
@@ -230,13 +230,17 @@ void drawTextBox(NVGcontext* vg, float x, float y, float size, float bound, cons
|
||||
nvgTextBox(vg, x, y, bound, str, end);
|
||||
}
|
||||
|
||||
void textBounds(NVGcontext* vg, float x, float y, float *bounds, const char* str, ...) {
|
||||
void textBounds(NVGcontext* vg, float x, float y, float *bounds, const char* str) {
|
||||
nvgTextBounds(vg, x, y, str, nullptr, bounds);
|
||||
}
|
||||
|
||||
void textBoundsArgs(NVGcontext* vg, float x, float y, float *bounds, const char* str, ...) {
|
||||
char buf[0x100];
|
||||
va_list v;
|
||||
va_start(v, str);
|
||||
std::vsnprintf(buf, sizeof(buf), str, v);
|
||||
va_end(v);
|
||||
nvgTextBounds(vg, x, y, buf, nullptr, bounds);
|
||||
textBounds(vg, x, y, bounds, buf);
|
||||
}
|
||||
|
||||
// NEW-----------
|
||||
|
||||
Reference in New Issue
Block a user