Another local ersatz vector cleaned.
This commit is contained in:
@ -141,15 +141,14 @@ void Polygon::draw (core::View *view, core::style::Style *style, int x, int y)
|
|||||||
if (points->size()) {
|
if (points->size()) {
|
||||||
int i;
|
int i;
|
||||||
const bool filled = false, convex = false;
|
const bool filled = false, convex = false;
|
||||||
Point *pointArray = (Point *)malloc(points->size()*sizeof(struct Point));
|
std::vector< Point > pointArray( points->size() );
|
||||||
|
|
||||||
for (i = 0; i < points->size(); i++) {
|
for (i = 0; i < points->size(); i++) {
|
||||||
pointArray[i].x = x + points->getRef(i)->x;
|
pointArray[i].x = x + points->getRef(i)->x;
|
||||||
pointArray[i].y = y + points->getRef(i)->y;
|
pointArray[i].y = y + points->getRef(i)->y;
|
||||||
}
|
}
|
||||||
view->drawPolygon(style->color, core::style::Color::SHADING_NORMAL,
|
view->drawPolygon(style->color, core::style::Color::SHADING_NORMAL,
|
||||||
filled, convex, pointArray, i);
|
filled, convex, pointArray.data(), i);
|
||||||
free(pointArray);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user