fix for Qt6

MapView add contrast property
MapView fix plugin
This commit is contained in:
2025-03-19 22:03:51 +03:00
parent f0c2369df0
commit 8df58026c4
4 changed files with 22 additions and 1 deletions

View File

@@ -81,6 +81,12 @@ void MapView::setZoom(double z) {
}
void MapView::setContrast(double value) {
contrast = piClampd(value, 0., 100.);
update();
}
QString MapView::cachePath() const {
return cache->cacheRoot();
}
@@ -258,6 +264,11 @@ void MapView::wheelEvent(QWheelEvent * e) {
void MapView::paintEvent(QPaintEvent *) {
QPainter p(this);
p.drawPixmap(0, 0, background);
if (contrast < 100.) {
auto col = palette().color(QPalette::Window);
col.setAlphaF(1. - contrast / 100.);
p.fillRect(rect(), col);
}
drawItems(p);
updateMouse(mapFromGlobal(QCursor::pos()));
}