CMake findQAD miss map

MapItemBase::offset feature
PIValueTreeEdit add custom button to show/hide groups
This commit is contained in:
2023-01-26 23:19:28 +03:00
parent 34d2653744
commit 7188e38072
9 changed files with 59 additions and 14 deletions

View File

@@ -78,8 +78,9 @@ void MapView::setZoom(double z) {
void MapView::mousePressEvent(QMouseEvent * e) {
is_pan = false;
press_point = e->pos();
is_pan = false;
press_point = e->pos();
last_click_coord = OSM::xy2geo(mapToNorm(press_point));
}
@@ -187,6 +188,7 @@ void MapView::drawItems(QPainter & p) {
QPointF ipos = mapFromNorm(i->norm_pos);
p.setTransform(src_tr);
p.translate(ipos);
p.translate(i->m_offset.x(), -i->m_offset.y());
p.rotate(i->getRotation());
if (!i->ignore_scale) p.scale(i->getScale().x(), i->getScale().y());
i->draw(&p);
@@ -257,6 +259,7 @@ void MapView::updateMouse(QPoint mouse) {
QTransform mtr;
if (!i->ignore_scale) mtr.scale(1. / i->getScale().x(), 1. / i->getScale().y());
mtr.rotate(-i->getRotation());
mtr.translate(-i->m_offset.x(), i->m_offset.y());
mtr.translate(-ipos.x(), -ipos.y());
QPoint m = mtr.map(mouse);
if (i->m_bounding.contains(m)) {