diff options
Diffstat (limited to 'boilerplate/cairo-boilerplate-xlib.c')
-rw-r--r-- | boilerplate/cairo-boilerplate-xlib.c | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c index 03febe90..f40f9271 100644 --- a/boilerplate/cairo-boilerplate-xlib.c +++ b/boilerplate/cairo-boilerplate-xlib.c @@ -188,10 +188,10 @@ _cairo_boilerplate_xlib_perf_create_surface (Display *dpy, cairo_surface_t * _cairo_boilerplate_xlib_create_surface (const char *name, cairo_content_t content, - int width, - int height, - int max_width, - int max_height, + double width, + double height, + double max_width, + double max_height, cairo_boilerplate_mode_t mode, int id, void **closure) @@ -202,9 +202,12 @@ _cairo_boilerplate_xlib_create_surface (const char *name, *closure = xtc = xcalloc (1, sizeof (xlib_target_closure_t)); - if (width == 0) + width = ceil (width); + if (width < 1) width = 1; - if (height == 0) + + height = ceil (height); + if (height < 1) height = 1; xtc->dpy = dpy = XOpenDisplay (NULL); @@ -228,10 +231,10 @@ _cairo_boilerplate_xlib_create_surface (const char *name, cairo_surface_t * _cairo_boilerplate_xlib_reference_create_surface (const char *name, cairo_content_t content, - int width, - int height, - int max_width, - int max_height, + double width, + double height, + double max_width, + double max_height, cairo_boilerplate_mode_t mode, int id, void **closure) @@ -253,9 +256,12 @@ _cairo_boilerplate_xlib_reference_create_surface (const char *name, *closure = xtc = xcalloc (1, sizeof (xlib_target_closure_t)); - if (width == 0) + width = ceil (width); + if (width < 1) width = 1; - if (height == 0) + + height = ceil (height); + if (height < 1) height = 1; xtc->dpy = dpy = XOpenDisplay (display); @@ -289,10 +295,10 @@ _cairo_boilerplate_xlib_reference_create_surface (const char *name, cairo_surface_t * _cairo_boilerplate_xlib_fallback_create_surface (const char *name, cairo_content_t content, - int width, - int height, - int max_width, - int max_height, + double width, + double height, + double max_width, + double max_height, cairo_boilerplate_mode_t mode, int id, void **closure) @@ -316,9 +322,12 @@ _cairo_boilerplate_xlib_fallback_create_surface (const char *name, *closure = xtc = xmalloc (sizeof (xlib_target_closure_t)); - if (width == 0) + width = ceil (width); + if (width < 1) width = 1; - if (height == 0) + + height = ceil (height); + if (height < 1) height = 1; xtc->dpy = dpy = XOpenDisplay (NULL); |