Commit b809b19f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus: Implement GdipTranslatePenTransform.

parent e7b16bcb
......@@ -460,17 +460,12 @@ GpStatus WINGDIPAPI GdipGetPenTransform(GpPen *pen, GpMatrix *matrix)
GpStatus WINGDIPAPI GdipTranslatePenTransform(GpPen *pen, REAL dx, REAL dy, GpMatrixOrder order)
{
static int calls;
TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, dx, dy, order);
if(!pen)
return InvalidParameter;
if(!(calls++))
FIXME("not implemented\n");
return NotImplemented;
return GdipTranslateMatrix(&pen->transform, dx, dy, order);
}
GpStatus WINGDIPAPI GdipScalePenTransform(GpPen *pen, REAL sx, REAL sy, GpMatrixOrder order)
......
......@@ -431,6 +431,38 @@ static void test_transform(void)
expectf(6.0, values[4]);
expectf(3.0, values[5]);
/* Translate */
status = GdipTranslatePenTransform(NULL, 1.0, -2.0, MatrixOrderAppend);
expect(InvalidParameter, status);
status = GdipTranslatePenTransform(pen, 1.0, -2.0, MatrixOrderAppend);
expect(Ok, status);
status = GdipGetPenTransform(pen, matrix);
expect(Ok, status);
status = GdipGetMatrixElements(matrix, values);
expect(Ok, status);
expectf(3.0, values[0]);
expectf(-2.0, values[1]);
expectf(5.0, values[2]);
expectf(2.0, values[3]);
expectf(7.0, values[4]);
expectf(1.0, values[5]);
status = GdipTranslatePenTransform(pen, -3.0, 5.0, MatrixOrderPrepend);
expect(Ok, status);
status = GdipGetPenTransform(pen, matrix);
expect(Ok, status);
status = GdipGetMatrixElements(matrix, values);
expect(Ok, status);
expectf(3.0, values[0]);
expectf(-2.0, values[1]);
expectf(5.0, values[2]);
expectf(2.0, values[3]);
expectf(23.0, values[4]);
expectf(17.0, values[5]);
status = GdipResetPenTransform(pen);
expect(Ok, status);
......
......@@ -656,6 +656,7 @@ GpStatus WINGDIPAPI GdipGetPenMiterLimit(GpPen*,REAL*);
GpStatus WINGDIPAPI GdipGetPenStartCap(GpPen*,GpLineCap*);
GpStatus WINGDIPAPI GdipGetPenUnit(GpPen*,GpUnit*);
GpStatus WINGDIPAPI GdipGetPenWidth(GpPen*,REAL*);
GpStatus WINGDIPAPI GdipTranslatePenTransform(GpPen*,REAL,REAL,GpMatrixOrder);
/* Region */
GpStatus WINGDIPAPI GdipCloneRegion(GpRegion *, GpRegion **);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment