unbreak overlay bottom and right positioning
svn path=/trunk/KDE/kdelibs/; revision=1062106
This commit is contained in:
parent
f38e7f4faf
commit
8f5f218470
11
framesvg.cpp
11
framesvg.cpp
@ -423,17 +423,18 @@ void FrameSvgPrivate::generateBackground(FrameData *frame)
|
|||||||
|
|
||||||
//Overlays
|
//Overlays
|
||||||
QSize overlaySize;
|
QSize overlaySize;
|
||||||
|
QPoint actualOverlayPos = QPoint(0, 0);
|
||||||
if (overlayAvailable && !overlayCached) {
|
if (overlayAvailable && !overlayCached) {
|
||||||
QPoint pos = QPoint(0, 0);
|
QPoint pos = QPoint(0, 0);
|
||||||
overlaySize = q->elementSize(prefix+"overlay");
|
overlaySize = q->elementSize(prefix+"overlay");
|
||||||
|
|
||||||
//Random pos, stretched and tiled are mutually exclusive
|
//Random pos, stretched and tiled are mutually exclusive
|
||||||
if (q->hasElement(prefix + "hint-overlay-random-pos")) {
|
if (q->hasElement(prefix + "hint-overlay-random-pos")) {
|
||||||
pos = overlayPos;
|
actualOverlayPos = overlayPos;
|
||||||
} else if (q->hasElement(prefix + "hint-overlay-pos-right")) {
|
} else if (q->hasElement(prefix + "hint-overlay-pos-right")) {
|
||||||
pos.setX(frame->frameSize.width() - overlaySize.width());
|
actualOverlayPos.setX(frame->frameSize.width() - overlaySize.width());
|
||||||
} else if (q->hasElement(prefix + "hint-overlay-pos-bottom")) {
|
} else if (q->hasElement(prefix + "hint-overlay-pos-bottom")) {
|
||||||
pos.setY(frame->frameSize.height() - overlaySize.height());
|
actualOverlayPos.setY(frame->frameSize.height() - overlaySize.height());
|
||||||
//Stretched or Tiled?
|
//Stretched or Tiled?
|
||||||
} else if (q->hasElement(prefix + "hint-overlay-stretch")) {
|
} else if (q->hasElement(prefix + "hint-overlay-stretch")) {
|
||||||
overlaySize = frameSize(frame).toSize();
|
overlaySize = frameSize(frame).toSize();
|
||||||
@ -459,7 +460,7 @@ void FrameSvgPrivate::generateBackground(FrameData *frame)
|
|||||||
overlayPainter.drawTiledPixmap(QRect(QPoint(0,0), overlaySize), q->pixmap(prefix+"overlay"));
|
overlayPainter.drawTiledPixmap(QRect(QPoint(0,0), overlaySize), q->pixmap(prefix+"overlay"));
|
||||||
q->resize(s);
|
q->resize(s);
|
||||||
} else {
|
} else {
|
||||||
q->paint(&overlayPainter, QRect(overlayPos, overlaySize), prefix+"overlay");
|
q->paint(&overlayPainter, QRect(actualOverlayPos, overlaySize), prefix+"overlay");
|
||||||
}
|
}
|
||||||
|
|
||||||
overlayPainter.end();
|
overlayPainter.end();
|
||||||
@ -472,7 +473,7 @@ void FrameSvgPrivate::generateBackground(FrameData *frame)
|
|||||||
if (!overlay.isNull()) {
|
if (!overlay.isNull()) {
|
||||||
QPainter p(&frame->cachedBackground);
|
QPainter p(&frame->cachedBackground);
|
||||||
p.setCompositionMode(QPainter::CompositionMode_SourceOver);
|
p.setCompositionMode(QPainter::CompositionMode_SourceOver);
|
||||||
p.drawPixmap(overlayPos, overlay, QRect(overlayPos, overlaySize));
|
p.drawPixmap(actualOverlayPos, overlay, QRect(actualOverlayPos, overlaySize));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user