diff options
Diffstat (limited to 'dw/types.cc')
-rw-r--r-- | dw/types.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/dw/types.cc b/dw/types.cc index 9dcedeea..074cb352 100644 --- a/dw/types.cc +++ b/dw/types.cc @@ -141,12 +141,11 @@ void Polygon::draw (core::View *view, core::style::Style *style, int x, int y) if (points->size()) { int i; const bool filled = false, convex = false; - int (*pointArray)[2] = - (int (*)[2]) malloc(points->size() * sizeof(*pointArray)); + Point *pointArray = (Point *)malloc(points->size()*sizeof(struct Point)); for (i = 0; i < points->size(); i++) { - pointArray[i][0] = x + points->getRef(i)->x; - pointArray[i][1] = y + points->getRef(i)->y; + pointArray[i].x = x + points->getRef(i)->x; + pointArray[i].y = y + points->getRef(i)->y; } view->drawPolygon(style->color, core::style::Color::SHADING_NORMAL, filled, convex, pointArray, i); |