diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2014-11-02 07:58:34 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2014-11-02 07:58:34 +0200 |
commit | e8fc51d80cdd955f47113f63e22068f3a00d4224 (patch) | |
tree | c6cd4ce8e3037004b8dd5da63933bba935a066bd /lib/renderers/cairo.h | |
parent | dfda59ad188f60acbc0e184aeca28a38f0649446 (diff) | |
download | bemenu-e8fc51d80cdd955f47113f63e22068f3a00d4224.tar.gz bemenu-e8fc51d80cdd955f47113f63e22068f3a00d4224.tar.bz2 bemenu-e8fc51d80cdd955f47113f63e22068f3a00d4224.zip |
Get output width and height.
Diffstat (limited to 'lib/renderers/cairo.h')
-rw-r--r-- | lib/renderers/cairo.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/renderers/cairo.h b/lib/renderers/cairo.h index 7eb5bd1..d9ba093 100644 --- a/lib/renderers/cairo.h +++ b/lib/renderers/cairo.h @@ -10,6 +10,10 @@ # define MAX(a,b) (((a)>(b))?(a):(b)) #endif +#ifndef MIN +# define MIN(a,b) (((a)<(b))?(a):(b)) +#endif + struct cairo { cairo_t *cr; cairo_surface_t *surface; @@ -145,7 +149,7 @@ bm_cairo_paint(struct cairo *cairo, uint32_t width, uint32_t height, const struc bm_cairo_draw_line(cairo, &paint, &result, "%s", (menu->filter ? menu->filter : "")); uint32_t displayed = 1; - uint32_t lines = MAX(height / (paint.fe.height + 4), menu->lines); + uint32_t lines = MAX(height / (paint.fe.height + 4), 1); if (lines > 1) { uint32_t start_x = 0; if (menu->prefix) { |