MapItemEllipse fix
This commit is contained in:
@@ -69,7 +69,8 @@ void MapItemEllipse::rebuild() {
|
|||||||
} else {
|
} else {
|
||||||
if (enda < starta) qSwap(starta, enda);
|
if (enda < starta) qSwap(starta, enda);
|
||||||
}
|
}
|
||||||
for (double a = starta; a <= enda; a += 3.) {
|
const double astep = 3.;
|
||||||
|
for (double a = starta; a < enda + astep; a += astep) {
|
||||||
if (a > enda) a = enda;
|
if (a > enda) a = enda;
|
||||||
QPointF p(sin(a * deg2rad) * w, cos(a * deg2rad) * h);
|
QPointF p(sin(a * deg2rad) * w, cos(a * deg2rad) * h);
|
||||||
pol << (c + p);
|
pol << (c + p);
|
||||||
|
|||||||
@@ -70,7 +70,19 @@ MainWindow::MainWindow(QWidget * parent): EMainWindow(parent), Ui::MainWindow()
|
|||||||
map->addItem(ell);
|
map->addItem(ell);
|
||||||
map->centerTo({55.583055, 37.580008});
|
map->centerTo({55.583055, 37.580008});
|
||||||
map->zoomTo(2);
|
map->zoomTo(2);
|
||||||
*/
|
|
||||||
|
for (int i = 1; i <= 8; ++i) {
|
||||||
|
double a = i * 0.5;
|
||||||
|
auto * ei = new MapItemEllipse();
|
||||||
|
ei->setStartAngle(-a);
|
||||||
|
ei->setEndAngle(a);
|
||||||
|
ei->setEllipse(QRectF(-100, -100, 200, 200));
|
||||||
|
ei->setUnits(MapItemNonGeoGeometryBase::Meters);
|
||||||
|
ei->setPosition(55.5858, 37.5782 + i / 1000.);
|
||||||
|
ei->setBrush(QColor(0, 0, 255, 64));
|
||||||
|
ei->setPen({Qt::blue});
|
||||||
|
map->addItem(ei);
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user