gdiplus: Add GdipSetCustomLineCapBaseCap implementation.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45273
This commit is contained in:
Bartosz Kosiorek 2022-11-07 17:35:50 +01:00 committed by Alexandre Julliard
parent aeb43dce75
commit 742c315702
3 changed files with 12 additions and 12 deletions

View file

@ -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;
}

View file

@ -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;

View file

@ -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);