From 739ccb9b2fa986d7f335b1fc62086c988f2fee2e Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sun, 5 Feb 2006 11:51:13 +0000 Subject: [PATCH] Changed the way the pen location is applied to shapes according to Stephan, removing the slower matrix calculation. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16233 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/drawing/Painter/Painter.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/servers/app/drawing/Painter/Painter.cpp b/src/servers/app/drawing/Painter/Painter.cpp index 266f658e2c..9e52408393 100644 --- a/src/servers/app/drawing/Painter/Painter.cpp +++ b/src/servers/app/drawing/Painter/Painter.cpp @@ -520,14 +520,14 @@ Painter::DrawShape(const int32& opCount, const uint32* opList, for (int32 i = 0; i < opCount; i++) { uint32 op = opList[i] & 0xFF000000; if (op & OP_MOVETO) { - path.move_to(points->x, points->y); + path.move_to(points->x + fPenLocation.x, points->y + fPenLocation.y); points++; } if (op & OP_LINETO) { int32 count = opList[i] & 0x00FFFFFF; while (count--) { - path.line_to(points->x, points->y); + path.line_to(points->x + fPenLocation.x, points->y + fPenLocation.y); points++; } } @@ -535,9 +535,9 @@ Painter::DrawShape(const int32& opCount, const uint32* opList, if (op & OP_BEZIERTO) { int32 count = opList[i] & 0x00FFFFFF; while (count) { - path.curve4(points[0].x, points[0].y, - points[1].x, points[1].y, - points[2].x, points[2].y); + path.curve4(points[0].x + fPenLocation.x, points[0].y + fPenLocation.y, + points[1].x + fPenLocation.x, points[1].y + fPenLocation.y, + points[2].x + fPenLocation.x, points[2].y + fPenLocation.y); points += 3; count -= 3; } @@ -547,10 +547,7 @@ Painter::DrawShape(const int32& opCount, const uint32* opList, path.close_polygon(); } - typedef agg::conv_transform conv_trans_type; - conv_trans_type transformed(path, agg::trans_affine_translation(fPenLocation.x, fPenLocation.y)); - agg::conv_curve curve(transformed); - + agg::conv_curve curve(path); if (filled) return _FillPath(curve); else