#include "mapitempolyline.h"


MapItemPolyline::MapItemPolyline(const QPolygonF & p) {
	setPolyline(p);
}


void MapItemPolyline::setPolyline(const QPolygonF & p) {
	pol = p;
	updateParent();
}


void MapItemPolyline::draw(QPainter * p) {
	p->setPen(pen());
	QPolygonF dp(pol);
	double us = unitScale();
	for (auto & i: dp)
		i = QPointF(i.x(), -i.y()) / us;
	p->drawPolyline(dp);
	setBoundingRect(dp.boundingRect());
}
