Module: wine Branch: master Commit: b809b19f84d983fccb51c1e3cff72b086b29ea4f URL: https://source.winehq.org/git/wine.git/?a=commit;h=b809b19f84d983fccb51c1e3c...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Sat Mar 24 16:10:12 2018 +0300
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
---
dlls/gdiplus/pen.c | 7 +------ dlls/gdiplus/tests/pen.c | 32 ++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index 2c49371..b86808b 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -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) diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c index ded6e64..be3d76d6 100644 --- a/dlls/gdiplus/tests/pen.c +++ b/dlls/gdiplus/tests/pen.c @@ -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);
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 7ea39f4..628db82 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -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 **);