summaryrefslogtreecommitdiff
path: root/src/vcr.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2025-11-05 21:15:53 -0800
committerVito Caputo <vcaputo@pengaru.com>2025-11-05 23:45:38 -0800
commit19bd3dd8a6ce18b54cfcea69a0724fe9da8a7543 (patch)
treec1f64a2c0f90e37158cc2a4bede603bcdde63548 /src/vcr.c
parent766710c1d5a8c02ed625b7dc36c6c948eb020fd0 (diff)
vcr: add flags for vcr_draw_text()
The current code assumes clipping text to the backend's bounds. I'd like to enable sticking text in the graph layers, which really needs to support wrapping to Just Work, because of how the graph layers are unwrapped @ present to keep the incremental rendering of the graphs efficient. So here let's treat the existing code as the clipped mode. Future commits will implement the wrapped mode.
Diffstat (limited to 'src/vcr.c')
-rw-r--r--src/vcr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vcr.c b/src/vcr.c
index 5406a9d..93155be 100644
--- a/src/vcr.c
+++ b/src/vcr.c
@@ -944,7 +944,7 @@ int vcr_resize_visible(vcr_t *vcr, int width, int height)
* x may be negative or extend outside vcr bounds, clipping will be performed as needed.
*/
/* XXX: maybe these strs should also include lengths instead of being null-terminated */
-void vcr_draw_text(vcr_t *vcr, vcr_layer_t layer, int x, int row, const vcr_str_t *strs, int n_strs, int *res_width)
+void vcr_draw_text(vcr_t *vcr, vcr_layer_t layer, vcr_text_flags_t flags, int x, int row, const vcr_str_t *strs, int n_strs, int *res_width)
{
assert(vcr);
assert(vcr->backend);
@@ -952,6 +952,7 @@ void vcr_draw_text(vcr_t *vcr, vcr_layer_t layer, int x, int row, const vcr_str_
assert(row >= 0 || res_width);
assert(strs);
assert(n_strs > 0);
+ assert(flags < VCR_TEXT_FLAGS_CNT);
/* FIXME: this should really be able to draw text into any valid layer,
* it's just the pictures/pixmaps in vcr_t aren't currently organized as an
* array easily indexed by the layer enum. TODO
© All Rights Reserved