diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 60e623c43a3..e4166e73f79 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -466,7 +466,7 @@ @ stdcall GdipRestoreGraphics(ptr long) @ stub GdipReversePath @ stub GdipRotateLineTransform -@ stub GdipRotateMatrix +@ stdcall GdipRotateMatrix(ptr long long) @ stub GdipRotatePathGradientTransform @ stub GdipRotatePenTransform @ stub GdipRotateTextureTransform diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c index 9d3a78f1a7a..928b5fe4f81 100644 --- a/dlls/gdiplus/matrix.c +++ b/dlls/gdiplus/matrix.c @@ -17,6 +17,7 @@ */ #include +#include #include "windef.h" #include "winbase.h" @@ -93,6 +94,33 @@ GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GpMatrix* matrix2, return Ok; } +GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix *matrix, REAL angle, + GpMatrixOrder order) +{ + REAL cos_theta, sin_theta, rotate[6]; + + if(!matrix) + return InvalidParameter; + + angle = deg2rad(angle); + cos_theta = cos(angle); + sin_theta = sin(angle); + + rotate[0] = cos_theta; + rotate[1] = sin_theta; + rotate[2] = -sin_theta; + rotate[3] = cos_theta; + rotate[4] = 0.0; + rotate[5] = 0.0; + + if(order == MatrixOrderAppend) + matrix_multiply(matrix->matrix, rotate, matrix->matrix); + else + matrix_multiply(rotate, matrix->matrix, matrix->matrix); + + return Ok; +} + GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 09e5a091cfb..b0c98407825 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -88,6 +88,7 @@ GpStatus WINGDIPAPI GdipTransformPath(GpPath*,GpMatrix*); GpStatus WINGDIPAPI GdipCreateMatrix2(REAL,REAL,REAL,REAL,REAL,REAL,GpMatrix**); GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix*); GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix*,GpMatrix*,GpMatrixOrder); +GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix*,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix*,GpPointF*,INT); GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder);