X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=acre.c;h=5177419ae1b8c7b203851a4878e3d6201101840b;hb=15f50e0679a920781b3a7d00ad1156b452e14a8f;hp=8c64cadc47484c51181185aa7df7cc28e795cf7a;hpb=c6775537fa163275f3c2b46692d0c9d87e6aeb10;p=acre diff --git a/acre.c b/acre.c index 8c64cad..5177419 100644 --- a/acre.c +++ b/acre.c @@ -347,6 +347,9 @@ _create_layout (acre_t *acre, const char *text) { PangoLayout *layout; + if (text == NULL) + text = ""; + layout = pango_cairo_create_layout (acre->cr); pango_layout_set_font_description (layout, acre->font); pango_layout_set_text (layout, text, -1); @@ -699,23 +702,6 @@ _compute_axis_ranges (acre_t *acre) } } - /* Next, we want to ensure that the data never collides with the - * ticks. So we expand each axis on its minimum side as needed. */ - cairo_save (cr); - { - double x, y; - - _set_transform_to_data_space (acre); - - x = ACRE_TICK_MAJOR_SIZE + 2.0; - y = ACRE_TICK_MAJOR_SIZE + 2.0; - cairo_device_to_user_distance (cr, &x, &y); - - acre->x_axis.view_min -= x; - acre->y_axis.view_min += y; - } - cairo_restore (cr); - /* Then, increase the axis ranges just enough so that the step * sizes for the ticks will be integers. */