added option for underlay opacity change
adjusted interface [removed invalid const]
This commit is contained in:
@@ -20,6 +20,7 @@ private:
|
||||
std::string tmpFile;
|
||||
Floorplan::UnderlayImage* underlay;
|
||||
BBox2 bbox;
|
||||
float opacity = 0.5;
|
||||
|
||||
int selPoint = -1;
|
||||
|
||||
@@ -55,6 +56,9 @@ public:
|
||||
selPoint = -1; // clear selection
|
||||
}
|
||||
|
||||
float getOpacity() const {return opacity;}
|
||||
void setOpacity(const float o) {this->opacity = o;}
|
||||
|
||||
void paint(Painter& p) override {
|
||||
(void) p;
|
||||
|
||||
@@ -101,9 +105,9 @@ public:
|
||||
imgScaled = QImage();
|
||||
}
|
||||
|
||||
|
||||
float opacity = p.p->opacity();
|
||||
p.p->setOpacity(0.50f);
|
||||
// current opacity?
|
||||
float _oldOpacity = p.p->opacity();
|
||||
p.p->setOpacity(opacity);
|
||||
|
||||
// render downscaled image from cache? or use live-upscaling (faster, eats up less memory, ...)
|
||||
if (imgScaled.width() > 0) {
|
||||
@@ -113,7 +117,8 @@ public:
|
||||
p.p->drawImage(QRectF(sx1, sy1-sh, sw, sh), img, QRectF(0,0,img.width(),img.height()));
|
||||
}
|
||||
|
||||
p.p->setOpacity(opacity);
|
||||
// reset
|
||||
p.p->setOpacity(_oldOpacity);
|
||||
|
||||
// selected endpoint(s)?
|
||||
if (hasFocus()) {
|
||||
|
||||
@@ -282,6 +282,7 @@ private:
|
||||
|
||||
(void) m;
|
||||
|
||||
// currently: only accept keys when something is focused
|
||||
if (focused) {
|
||||
|
||||
// pass it to the element which may consume this event
|
||||
|
||||
Reference in New Issue
Block a user