Revert "Support mirroring the source rectangle of ShaderEffectSource."
This reverts commit 155faa3b8b
.
The original commit broke behavior enforced by the tst_qdeclarativeqt
unit test, specifically relating to QRectF.
This commit is contained in:
parent
d90a4c05c3
commit
616c7e768f
|
@ -774,12 +774,12 @@ QSGNode *QSGShaderEffectSource::updatePaintNode(QSGNode *oldNode, UpdatePaintNod
|
||||||
|
|
||||||
tex->setLive(m_live);
|
tex->setLive(m_live);
|
||||||
tex->setItem(QSGItemPrivate::get(m_sourceItem)->itemNode());
|
tex->setItem(QSGItemPrivate::get(m_sourceItem)->itemNode());
|
||||||
QRectF sourceRect = m_sourceRect.isNull()
|
QRectF sourceRect = m_sourceRect.isEmpty()
|
||||||
? QRectF(0, 0, m_sourceItem->width(), m_sourceItem->height())
|
? QRectF(0, 0, m_sourceItem->width(), m_sourceItem->height())
|
||||||
: m_sourceRect;
|
: m_sourceRect;
|
||||||
tex->setRect(sourceRect);
|
tex->setRect(sourceRect);
|
||||||
QSize textureSize = m_textureSize.isEmpty()
|
QSize textureSize = m_textureSize.isEmpty()
|
||||||
? QSize(qCeil(qAbs(sourceRect.width())), qCeil(qAbs(sourceRect.height())))
|
? QSize(qCeil(sourceRect.width()), qCeil(sourceRect.height()))
|
||||||
: m_textureSize;
|
: m_textureSize;
|
||||||
tex->setSize(textureSize);
|
tex->setSize(textureSize);
|
||||||
tex->setRecursive(m_recursive);
|
tex->setRecursive(m_recursive);
|
||||||
|
|
|
@ -1740,6 +1740,9 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine
|
||||||
qsreal w = ctxt->argument(2).toNumber();
|
qsreal w = ctxt->argument(2).toNumber();
|
||||||
qsreal h = ctxt->argument(3).toNumber();
|
qsreal h = ctxt->argument(3).toNumber();
|
||||||
|
|
||||||
|
if (w < 0 || h < 0)
|
||||||
|
return engine->nullValue();
|
||||||
|
|
||||||
return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QRectF(x, y, w, h)));
|
return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QRectF(x, y, w, h)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue