diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2025-08-10 11:37:52 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2025-09-11 21:21:44 -0700 |
commit | 733fa3c2722a2c59d3e5a27b8becf19a86caf302 (patch) | |
tree | 14b49827ff7a70e38c3036c5211104f5b6b61d06 /src/vcr.h | |
parent | ed683c9966edc3522aec958bdb40e8ff8a20287f (diff) |
vcr: make vcr_draw_bar() base explicit parameter
Get rid of the overloaded meaning of negative values indicating
base. While here also put the min_height logic in charts, the
vcr side of this should be more dumb mechanism and less policy.
While here these pixel space scaled heights should really get
rounded to the nearest int in the scaled float->int conversion,
otherwise 13.9 height becomes 13 when it should clearly be 14.
Diffstat (limited to 'src/vcr.h')
-rw-r--r-- | src/vcr.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -38,6 +38,12 @@ typedef enum vcr_layer_t { VCR_LAYER_CNT, } vcr_layer_t; +typedef enum vcr_bar_base_t { + VCR_BAR_BASE_BOTTOM, + VCR_BAR_BASE_TOP, + VCR_BAR_BASE_CNT +} vcr_bar_base_t; + typedef struct vcr_backend_t vcr_backend_t; typedef struct vcr_dest_t vcr_dest_t; typedef struct vcr_t vcr_t; @@ -69,7 +75,7 @@ int vcr_resize_visible(vcr_t *vcr, int width, int height); 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_ortho_line(vcr_t *vcr, vcr_layer_t layer, int x1, int y1, int x2, int y2); void vcr_mark_finish_line(vcr_t *vcr, vcr_layer_t layer, int row); -void vcr_draw_bar(vcr_t *vcr, vcr_layer_t layer, int row, float t, int min_height); +void vcr_draw_bar(vcr_t *vcr, vcr_layer_t layer, vcr_bar_base_t base, int row, int height); void vcr_clear_row(vcr_t *vcr, vcr_layer_t layer, int row, int x, int width); void vcr_shift_below_row_up_one(vcr_t *vcr, int row); void vcr_shift_below_row_down_one(vcr_t *vcr, int row); |