Nikolay Sivov : gdiplus: Implement GdipRotatePenTransform().

Alexandre Julliard julliard at winehq.org
Wed Oct 24 15:13:54 CDT 2018


Module: wine
Branch: master
Commit: 363326678cd2f473b6fcf3d141846fa79007837d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=363326678cd2f473b6fcf3d141846fa79007837d

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Oct 24 00:04:18 2018 +0300

gdiplus: Implement GdipRotatePenTransform().

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdiplus/pen.c       |  7 +------
 dlls/gdiplus/tests/pen.c | 38 ++++++++++++++++++++++++++++++++++++++
 include/gdiplusflat.h    |  1 +
 3 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c
index ad45bcb..8bcb918 100644
--- a/dlls/gdiplus/pen.c
+++ b/dlls/gdiplus/pen.c
@@ -480,17 +480,12 @@ GpStatus WINGDIPAPI GdipScalePenTransform(GpPen *pen, REAL sx, REAL sy, GpMatrix
 
 GpStatus WINGDIPAPI GdipRotatePenTransform(GpPen *pen, REAL angle, GpMatrixOrder order)
 {
-    static int calls;
-
     TRACE("(%p,%0.2f,%u)\n", pen, angle, order);
 
     if(!pen)
         return InvalidParameter;
 
-    if(!(calls++))
-        FIXME("not implemented\n");
-
-    return NotImplemented;
+    return GdipRotateMatrix(&pen->transform, angle, order);
 }
 
 GpStatus WINGDIPAPI GdipMultiplyPenTransform(GpPen *pen, GDIPCONST GpMatrix *matrix,
diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c
index 530967a..ceab92a 100644
--- a/dlls/gdiplus/tests/pen.c
+++ b/dlls/gdiplus/tests/pen.c
@@ -588,6 +588,44 @@ static void test_transform(void)
     expectf(-15.0, values[4]);
     expectf(-76.0, values[5]);
 
+    /* Rotate */
+    status = GdipResetPenTransform(pen);
+    expect(Ok, status);
+
+    status = GdipSetMatrixElements(matrix, 2.0, 1.0, 1.0, 4.0, 1.0, 2.0);
+    expect(Ok, status);
+
+    status = GdipSetPenTransform(pen, matrix);
+    expect(Ok, status);
+
+    status = GdipRotatePenTransform(NULL, 10.0, MatrixOrderPrepend);
+    expect(InvalidParameter, status);
+
+    status = GdipRotatePenTransform(pen, 45.0, MatrixOrderPrepend);
+    expect(Ok, status);
+
+    get_pen_transform(pen, values);
+    expectf(2.12, values[0]);
+    expectf(3.54, values[1]);
+    expectf(-0.71, values[2]);
+    expectf(2.12, values[3]);
+    expectf(1.0, values[4]);
+    expectf(2.0, values[5]);
+
+    status = GdipScalePenTransform(pen, 2.0, -10.0, MatrixOrderAppend);
+    expect(Ok, status);
+
+    status = GdipRotatePenTransform(pen, 180.0, MatrixOrderAppend);
+    expect(Ok, status);
+
+    get_pen_transform(pen, values);
+    expectf(-4.24, values[0]);
+    expectf(35.36, values[1]);
+    expectf(1.41, values[2]);
+    expectf(21.21, values[3]);
+    expectf(-2.0, values[4]);
+    expectf(20.0, values[5]);
+
     GdipDeletePen(pen);
 
     GdipDeleteMatrix(matrix);
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 5593ac5..ad944d6 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -631,6 +631,7 @@ GpStatus WINGDIPAPI GdipGetPenMode(GpPen*,GpPenAlignment*);
 GpStatus WINGDIPAPI GdipGetPenTransform(GpPen *, GpMatrix *);
 GpStatus WINGDIPAPI GdipMultiplyPenTransform(GpPen *,GDIPCONST GpMatrix *,GpMatrixOrder);
 GpStatus WINGDIPAPI GdipResetPenTransform(GpPen*);
+GpStatus WINGDIPAPI GdipRotatePenTransform(GpPen*,REAL,GpMatrixOrder);
 GpStatus WINGDIPAPI GdipScalePenTransform(GpPen*,REAL,REAL,GpMatrixOrder);
 GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen*,GpBrush*);
 GpStatus WINGDIPAPI GdipSetPenColor(GpPen*,ARGB);




More information about the wine-cvs mailing list