diff --git a/src/common/cairo.cpp b/src/common/cairo.cpp index 940299dad0..3b86f79192 100644 --- a/src/common/cairo.cpp +++ b/src/common/cairo.cpp @@ -100,6 +100,8 @@ (cairo_t *cr, double alpha), (cr, alpha) ) \ m( cairo_path_destroy, \ (cairo_path_t *path), (path) ) \ + m( cairo_path_extents, \ + (cairo_t *cr, double *x1, double *y1, double *x2, double *y2), (cr, x1, y1, x2, y2) ) \ m( cairo_pattern_add_color_stop_rgba, \ (cairo_pattern_t *pattern, double offset, double red, double green, double blue, double alpha), (pattern, offset, red, green, blue, alpha) ) \ m( cairo_pattern_destroy, \ diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index ddf2f94c52..1f6b875613 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -1195,7 +1195,17 @@ void wxCairoPathData::GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) { double x1,y1,x2,y2; - cairo_stroke_extents( m_pathContext, &x1, &y1, &x2, &y2 ); +#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0) + if ( cairo_version() >= CAIRO_VERSION_ENCODE(1, 6, 0) ) + { + cairo_path_extents(m_pathContext, &x1, &y1, &x2, &y2); + } + else +#endif + { + cairo_stroke_extents(m_pathContext, &x1, &y1, &x2, &y2); + } + if ( x2 < x1 ) { *x = x2;