From 742c315702016b4c4cec2a3195c462410796c7c1 Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Mon, 7 Nov 2022 17:35:50 +0100 Subject: [PATCH] gdiplus: Add GdipSetCustomLineCapBaseCap implementation. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45273 --- dlls/gdiplus/customlinecap.c | 17 ++++++++--------- dlls/gdiplus/gdiplus_private.h | 2 +- dlls/gdiplus/tests/customlinecap.c | 5 +++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/gdiplus/customlinecap.c b/dlls/gdiplus/customlinecap.c index c74928eeda6..2e7b000355e 100644 --- a/dlls/gdiplus/customlinecap.c +++ b/dlls/gdiplus/customlinecap.c @@ -96,7 +96,7 @@ static GpStatus init_custom_linecap(GpCustomLineCap *cap, GpPathData *pathdata, cap->pathdata.Count = pathdata->Count; cap->inset = base_inset; - cap->cap = basecap; + cap->basecap = basecap; cap->join = LineJoinMiter; cap->scale = 1.0; @@ -193,16 +193,15 @@ GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps(GpCustomLineCap* custom, } GpStatus WINGDIPAPI GdipSetCustomLineCapBaseCap(GpCustomLineCap* custom, - GpLineCap base) + GpLineCap basecap) { - static int calls; + TRACE("(%p,%u)\n", custom, basecap); + if(!custom || basecap > LineCapTriangle) + return InvalidParameter; - TRACE("(%p,%u)\n", custom, base); + custom->basecap = basecap; - if(!(calls++)) - FIXME("not implemented\n"); - - return NotImplemented; + return Ok; } GpStatus WINGDIPAPI GdipGetCustomLineCapBaseInset(GpCustomLineCap* custom, @@ -264,7 +263,7 @@ GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap(GpCustomLineCap *customCap, GpLi if(!customCap || !baseCap) return InvalidParameter; - *baseCap = customCap->cap; + *baseCap = customCap->basecap; return Ok; } diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 0c55af6614a..77b35659946 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -351,7 +351,7 @@ struct GpCustomLineCap{ CustomLineCapType type; GpPathData pathdata; BOOL fill; /* TRUE for fill, FALSE for stroke */ - GpLineCap cap; /* as far as I can tell, this value is ignored */ + GpLineCap basecap; /* cap used together with customLineCap */ REAL inset; /* how much to adjust the end of the line */ GpLineJoin join; REAL scale; diff --git a/dlls/gdiplus/tests/customlinecap.c b/dlls/gdiplus/tests/customlinecap.c index 26175ca8f66..c475216ff21 100644 --- a/dlls/gdiplus/tests/customlinecap.c +++ b/dlls/gdiplus/tests/customlinecap.c @@ -283,14 +283,15 @@ static void test_create_adjustable_cap(void) ok(base == LineCapTriangle, "Unexpected base cap %d\n", base); stat = GdipSetCustomLineCapBaseCap((GpCustomLineCap*)cap, LineCapSquare); - todo_wine ok(stat == Ok, "Unexpected return code, %d\n", stat); stat = GdipGetCustomLineCapBaseCap((GpCustomLineCap*)cap, &base); ok(stat == Ok, "Unexpected return code, %d\n", stat); - todo_wine ok(base == LineCapSquare, "Unexpected base cap %d\n", base); + stat = GdipSetCustomLineCapBaseCap((GpCustomLineCap*)cap, LineCapSquareAnchor); + ok(stat == InvalidParameter, "Unexpected return code, %d\n", stat); + /* Base inset */ stat = GdipGetAdjustableArrowCapWidth(cap, &width); ok(stat == Ok, "Unexpected return code, %d\n", stat);