Fix overlay clipping by applying clipping before painter transformations
This commit is contained in:
parent
6332e74d1f
commit
6fc82c9487
1 changed files with 5 additions and 5 deletions
|
@ -25,17 +25,17 @@ void Overlay::renderItems(QPainter *painter) {
|
|||
|
||||
painter->save();
|
||||
|
||||
if (this->clippingRect) {
|
||||
painter->setClipping(true);
|
||||
painter->setClipRect(*this->clippingRect);
|
||||
}
|
||||
|
||||
QTransform transform = painter->transform();
|
||||
transform.translate(this->x, this->y);
|
||||
transform.rotate(this->angle);
|
||||
transform.scale(this->hScale, this->vScale);
|
||||
painter->setTransform(transform);
|
||||
|
||||
if (this->clippingRect) {
|
||||
painter->setClipping(true);
|
||||
painter->setClipRect(*this->clippingRect);
|
||||
}
|
||||
|
||||
painter->setOpacity(this->opacity);
|
||||
for (auto item : this->items)
|
||||
item->render(painter);
|
||||
|
|
Loading…
Reference in a new issue