[1/3] gdiplus: Add a test to check transformation order in GdipMeasureDriverString.
Dmitry Timoshkov
dmitry at baikal.ru
Fri Nov 2 05:17:06 CDT 2012
---
dlls/gdiplus/tests/font.c | 57 ++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 54 insertions(+), 3 deletions(-)
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c
index de6d657..ead3736 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -947,7 +947,7 @@ todo_wine
todo_wine
expectf(height * 3.0, bounds.Height);
- /* scale + ratate matrix */
+ /* scale + rotate matrix */
status = GdipRotateMatrix(matrix, 45.0, MatrixOrderAppend);
expect(Ok, status);
status = GdipSetWorldTransform(graphics, matrix);
@@ -997,7 +997,7 @@ todo_wine
todo_wine
expectf_(340.847534, bounds.Height, 0.05);
- /* scale + ratate + shear matrix */
+ /* scale + rotate + shear matrix */
status = GdipShearMatrix(matrix, 4.0, 5.0, MatrixOrderAppend);
expect(Ok, status);
status = GdipSetWorldTransform(graphics, matrix);
@@ -1048,7 +1048,7 @@ todo_wine
todo_wine
expectf_(1532.984985, bounds.Height, 0.05);
- /* scale + ratate + shear + translate matrix */
+ /* scale + rotate + shear + translate matrix */
status = GdipTranslateMatrix(matrix, 10.0, 20.0, MatrixOrderAppend);
expect(Ok, status);
status = GdipSetWorldTransform(graphics, matrix);
@@ -1100,6 +1100,57 @@ todo_wine
expectf_(1532.984985, bounds.Height, 0.05);
GdipDeleteMatrix(matrix);
+
+ /* rotate world transform + scale matrix */
+ status = GdipCreateMatrix(&matrix);
+ expect(Ok, status);
+ status = GdipRotateMatrix(matrix, 45.0, MatrixOrderAppend);
+ expect(Ok, status);
+ status = GdipSetWorldTransform(graphics, matrix);
+ expect(Ok, status);
+ GdipDeleteMatrix(matrix);
+ status = GdipCreateMatrix(&matrix);
+ expect(Ok, status);
+ status = GdipScaleMatrix(matrix, 2.0, 3.0, MatrixOrderAppend);
+ expect(Ok, status);
+
+ set_rect_empty(&bounds);
+ status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
+ DriverStringOptionsCmapLookup, matrix, &bounds);
+ expect(Ok, status);
+ expectf(0.0, bounds.X);
+todo_wine
+ expectf_(-300.0, bounds.Y, 0.15);
+todo_wine
+ expectf(height * 3.0, bounds.Height);
+
+ GdipDeleteMatrix(matrix);
+
+ /* scale world transform + rotate matrix */
+ status = GdipCreateMatrix(&matrix);
+ expect(Ok, status);
+ status = GdipScaleMatrix(matrix, 2.0, 3.0, MatrixOrderAppend);
+ expect(Ok, status);
+ status = GdipSetWorldTransform(graphics, matrix);
+ expect(Ok, status);
+ GdipDeleteMatrix(matrix);
+ status = GdipCreateMatrix(&matrix);
+ expect(Ok, status);
+ status = GdipRotateMatrix(matrix, 45.0, MatrixOrderAppend);
+ expect(Ok, status);
+
+ set_rect_empty(&bounds);
+ status = GdipMeasureDriverString(graphics, (const UINT16 *)string, -1, font, pos,
+ DriverStringOptionsCmapLookup, matrix, &bounds);
+ expect(Ok, status);
+todo_wine
+ expectf(-14.604793, bounds.X);
+todo_wine
+ expectf_(-70.745209, bounds.Y, 0.15);
+todo_wine
+ expectf(127.748779, bounds.Height);
+
+ GdipDeleteMatrix(matrix);
GdipDeleteFont(font);
GdipDeleteGraphics(graphics);
GdipDeleteStringFormat(typographic);
--
1.7.12.4
More information about the wine-patches
mailing list