diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c index a92bcd679..6aaa2eef6 100644 --- a/src/cairo-path-fixed.c +++ b/src/cairo-path-fixed.c @@ -340,21 +340,18 @@ _cairo_path_fixed_close_path (cairo_path_fixed_t *path) return CAIRO_STATUS_SUCCESS; } -cairo_status_t +cairo_bool_t _cairo_path_fixed_get_current_point (cairo_path_fixed_t *path, cairo_fixed_t *x, cairo_fixed_t *y) { - if (! path->has_current_point) { - /* No need for _cairo_error() as the only caller, - * cairo_get_current_point(), expects and handles NO_CURRENT_POINT */ - return CAIRO_STATUS_NO_CURRENT_POINT; - } + if (! path->has_current_point) + return FALSE; *x = path->current_point.x; *y = path->current_point.y; - return CAIRO_STATUS_SUCCESS; + return TRUE; } static cairo_status_t diff --git a/src/cairo.c b/src/cairo.c index 73c2dc455..d5ee15c63 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -3166,20 +3166,17 @@ cairo_get_antialias (cairo_t *cr) void cairo_get_current_point (cairo_t *cr, double *x_ret, double *y_ret) { - cairo_status_t status = CAIRO_STATUS_NO_CURRENT_POINT; cairo_fixed_t x_fixed, y_fixed; double x, y; - if (cr->status == CAIRO_STATUS_SUCCESS) - status = _cairo_path_fixed_get_current_point (cr->path, - &x_fixed, &y_fixed); - if (status == CAIRO_STATUS_NO_CURRENT_POINT) { - x = 0.0; - y = 0.0; - } else { + if (cr->status == CAIRO_STATUS_SUCCESS && + _cairo_path_fixed_get_current_point (cr->path, &x_fixed, &y_fixed)) { x = _cairo_fixed_to_double (x_fixed); y = _cairo_fixed_to_double (y_fixed); _cairo_gstate_backend_to_user (cr->gstate, &x, &y); + } else { + x = 0.0; + y = 0.0; } if (x_ret) diff --git a/src/cairoint.h b/src/cairoint.h index 16e8a0892..225cb4bcd 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -1479,7 +1479,7 @@ _cairo_path_fixed_rel_curve_to (cairo_path_fixed_t *path, cairo_private cairo_status_t _cairo_path_fixed_close_path (cairo_path_fixed_t *path); -cairo_private cairo_status_t +cairo_private cairo_bool_t _cairo_path_fixed_get_current_point (cairo_path_fixed_t *path, cairo_fixed_t *x, cairo_fixed_t *y);