From f35bfff4fcdfdba34ff7cda0544a15ba7f889c53 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 6 Oct 2015 18:48:21 +0200 Subject: [PATCH] d2d1: Properly handle the candidate being the last vertex before the base edge origin in d2d_cdt_fixup(). Signed-off-by: Henri Verbeet --- dlls/d2d1/geometry.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c index a705723b4da..7400f81d6fa 100644 --- a/dlls/d2d1/geometry.c +++ b/dlls/d2d1/geometry.c @@ -712,7 +712,12 @@ static BOOL d2d_cdt_fixup(struct d2d_cdt *cdt, const struct d2d_cdt_edge_ref *ba if (count > 1) { - if (!d2d_cdt_connect(cdt, &new_base, &candidate, base_edge)) + d2d_cdt_edge_next_left(cdt, &next, &candidate); + if (d2d_cdt_edge_destination(cdt, &next) == d2d_cdt_edge_origin(cdt, base_edge)) + d2d_cdt_edge_next_left(cdt, &next, base_edge); + else + next = *base_edge; + if (!d2d_cdt_connect(cdt, &new_base, &candidate, &next)) return FALSE; if (!d2d_cdt_fixup(cdt, &new_base)) return FALSE;