From 42fc0af325226af38f62fa9b973027529e74c576 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 20 Nov 2021 21:50:59 +0000 Subject: [PATCH] Issue #3039 - Add closure point to bounds calculation. This addition of a closure point (explicitly completing the closed shape) isn't strictly needed in our current cairo version as it works perfectly fine without, but if our clipping extents code changes then this might cause problems if the extra point isn't added (in case of 0-length paths). --- gfx/cairo/cairo/src/cairo-path-bounds.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gfx/cairo/cairo/src/cairo-path-bounds.c b/gfx/cairo/cairo/src/cairo-path-bounds.c index c752fbca1d..701539e3a3 100644 --- a/gfx/cairo/cairo/src/cairo-path-bounds.c +++ b/gfx/cairo/cairo/src/cairo-path-bounds.c @@ -107,6 +107,16 @@ _cairo_path_bounder_curve_to (void *closure, static cairo_status_t _cairo_path_bounder_close_path (void *closure) { + // XXXMC: This addition of a closure point isn't strictly needed but + // if our clipping extents code changes then this might cause problems + // if the extra point isn't added (in case of 0-length paths). + cairo_path_bounder_t *bounder = closure; + + if (bounder->has_initial_point) { + _cairo_path_bounder_add_point (bounder, &bounder->current_point); + bounder->has_initial_point = FALSE; + } + return CAIRO_STATUS_SUCCESS; }