Fix overlay clipping by applying clipping before painter transformations

This commit is contained in:
Marcus Huderle 2022-10-23 10:08:59 -05:00
parent 6332e74d1f
commit 6fc82c9487

View file

@ -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);