From 8935ef8d9bdc0686f5ddf8ca16409d46e7133d32 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Mon, 17 Nov 2008 10:08:44 -0600 Subject: [PATCH] gdiplus: restore a line I removed by mistake eddc1275885a8495d8506fffbd5407953e234c0c changed the way Bezier curves are handled in GdipFlattenPath, and it shouldn't have. This reverts that change. I've also changed the type & ~PathPointTypeBezier idiom to use PathPointPathTypeMask instead. The intention is to reset the type bits so the point type can be changed. Gdiplus reserves bits 0 through 2 for point types. &~PathPointTypeBezier happens to work for all currently-defined type values, but it will break if a new type uses bit 2. This should be clearer and more future-proof. --- dlls/gdiplus/graphicspath.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 22b27e4..20a3b2c 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -994,6 +994,7 @@ GpStatus WINGDIPAPI GdipFlattenPath(GpPath *path, GpMatrix* matrix, REAL flatnes /* Bezier curve always stored as 4 points */ if((path->pathdata.Types[i-1] & PathPointTypePathTypeMask) != PathPointTypeStart){ + type = (path->pathdata.Types[i] & ~PathPointTypePathTypeMask) | PathPointTypeLine; if(!add_path_list_node(node, pt.X, pt.Y, type)) goto memout; @@ -1013,7 +1014,7 @@ GpStatus WINGDIPAPI GdipFlattenPath(GpPath *path, GpMatrix* matrix, REAL flatnes start = node; /* add Bezier end point */ - type = (path->pathdata.Types[i] & ~PathPointTypeBezier) | PathPointTypeLine; + type = (path->pathdata.Types[i] & ~PathPointTypePathTypeMask) | PathPointTypeLine; if(!add_path_list_node(node, pt.X, pt.Y, type)) goto memout; node = node->next; -- 1.5.6.3