fix for Qt6
MapView add contrast property MapView fix plugin
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user