gdiplus: Implement GdipRotatePenTransform().
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:
parent
1c93654885
commit
363326678c
|
@ -480,17 +480,12 @@ GpStatus WINGDIPAPI GdipScalePenTransform(GpPen *pen, REAL sx, REAL sy, GpMatrix
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipRotatePenTransform(GpPen *pen, REAL angle, GpMatrixOrder order)
|
GpStatus WINGDIPAPI GdipRotatePenTransform(GpPen *pen, REAL angle, GpMatrixOrder order)
|
||||||
{
|
{
|
||||||
static int calls;
|
|
||||||
|
|
||||||
TRACE("(%p,%0.2f,%u)\n", pen, angle, order);
|
TRACE("(%p,%0.2f,%u)\n", pen, angle, order);
|
||||||
|
|
||||||
if(!pen)
|
if(!pen)
|
||||||
return InvalidParameter;
|
return InvalidParameter;
|
||||||
|
|
||||||
if(!(calls++))
|
return GdipRotateMatrix(&pen->transform, angle, order);
|
||||||
FIXME("not implemented\n");
|
|
||||||
|
|
||||||
return NotImplemented;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipMultiplyPenTransform(GpPen *pen, GDIPCONST GpMatrix *matrix,
|
GpStatus WINGDIPAPI GdipMultiplyPenTransform(GpPen *pen, GDIPCONST GpMatrix *matrix,
|
||||||
|
|
|
@ -588,6 +588,44 @@ static void test_transform(void)
|
||||||
expectf(-15.0, values[4]);
|
expectf(-15.0, values[4]);
|
||||||
expectf(-76.0, values[5]);
|
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);
|
GdipDeletePen(pen);
|
||||||
|
|
||||||
GdipDeleteMatrix(matrix);
|
GdipDeleteMatrix(matrix);
|
||||||
|
|
|
@ -631,6 +631,7 @@ GpStatus WINGDIPAPI GdipGetPenMode(GpPen*,GpPenAlignment*);
|
||||||
GpStatus WINGDIPAPI GdipGetPenTransform(GpPen *, GpMatrix *);
|
GpStatus WINGDIPAPI GdipGetPenTransform(GpPen *, GpMatrix *);
|
||||||
GpStatus WINGDIPAPI GdipMultiplyPenTransform(GpPen *,GDIPCONST GpMatrix *,GpMatrixOrder);
|
GpStatus WINGDIPAPI GdipMultiplyPenTransform(GpPen *,GDIPCONST GpMatrix *,GpMatrixOrder);
|
||||||
GpStatus WINGDIPAPI GdipResetPenTransform(GpPen*);
|
GpStatus WINGDIPAPI GdipResetPenTransform(GpPen*);
|
||||||
|
GpStatus WINGDIPAPI GdipRotatePenTransform(GpPen*,REAL,GpMatrixOrder);
|
||||||
GpStatus WINGDIPAPI GdipScalePenTransform(GpPen*,REAL,REAL,GpMatrixOrder);
|
GpStatus WINGDIPAPI GdipScalePenTransform(GpPen*,REAL,REAL,GpMatrixOrder);
|
||||||
GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen*,GpBrush*);
|
GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen*,GpBrush*);
|
||||||
GpStatus WINGDIPAPI GdipSetPenColor(GpPen*,ARGB);
|
GpStatus WINGDIPAPI GdipSetPenColor(GpPen*,ARGB);
|
||||||
|
|
Loading…
Reference in New Issue