Copy the state to the picture paintengine when updating the state

When the state of the paint changes then the one used for the picture
paintengine needs to be kept in sync. Otherwise the rendering will be
incorrect.

Task-number: QTBUG-43145
Change-Id: Ia55a4e940d109bedb7c2eff4d985d3b212da75a4
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This commit is contained in:
Andy Shaw 2015-08-28 10:34:43 +02:00
parent 1840cc982a
commit fbd0e4489c

View File

@ -146,8 +146,16 @@ void QAlphaPaintEngine::updateState(const QPaintEngineState &state)
d->m_hasalpha = d->m_alphaOpacity || d->m_alphaBrush || d->m_alphaPen;
if (d->m_picengine)
if (d->m_picengine) {
const QPainter *p = painter();
d->m_picpainter->setPen(p->pen());
d->m_picpainter->setBrush(p->brush());
d->m_picpainter->setBrushOrigin(p->brushOrigin());
d->m_picpainter->setFont(p->font());
d->m_picpainter->setOpacity(p->opacity());
d->m_picpainter->setTransform(p->combinedTransform());
d->m_picengine->updateState(state);
}
}
void QAlphaPaintEngine::drawPath(const QPainterPath &path)