box-drawing: QUADRANTs: ensure all quads have equal width and hight

If the cell width/height is odd, the previous implementation would
result in uneven quads.
This commit is contained in:
Daniel Eklöf 2020-12-27 19:44:30 +01:00
parent ddc997dd5e
commit 17a46378bf
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -91,10 +91,10 @@ rectangle(uint8_t *buf, int x1, int y1, int x2, int y2, int stride)
#define rect(x1, y1, x2, y2) rectangle(buf, x1, y1, x2, y2, stride)
#define quad_upper_left() rect(0, 0, width / 2, height / 2)
#define quad_upper_right() rect(width / 2, 0, width, height / 2)
#define quad_lower_left() rect(0, height / 2, width / 2, height)
#define quad_lower_right() rect(width / 2, height / 2, width, height)
#define quad_upper_left() rect(0, 0, ceil(width / 2.), ceil(height / 2.))
#define quad_upper_right() rect(floor(width / 2.), 0, width, ceil(height / 2.))
#define quad_lower_left() rect(0, floor(height / 2.), ceil(width / 2.), height)
#define quad_lower_right() rect(floor(width / 2.), floor(height / 2.), width, height)
static void
draw_box_drawings_light_horizontal(uint8_t *buf, int width, int height, int stride, int dpi)