gdiplus: Implement GdipTranslatePenTransform.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-03-24 16:10:12 +03:00 committed by Alexandre Julliard
parent e7b16bcb57
commit b809b19f84
3 changed files with 34 additions and 6 deletions

View file

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

View file

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

View file

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