From 9d7eb51da37e8dffbe284fc564c9b9f08a89bea2 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Thu, 19 May 2011 10:26:55 +0200 Subject: Re-apply "Support mirroring the source rectangle of ShaderEffectSource." This reverts commit 616c7e768f3d88f6b8be6af72290769e99500e72. --- src/declarative/items/qsgshadereffectsource.cpp | 4 ++-- src/declarative/qml/qdeclarativeengine.cpp | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/declarative/items/qsgshadereffectsource.cpp b/src/declarative/items/qsgshadereffectsource.cpp index 217b0e67a7..e2c50bb80e 100644 --- a/src/declarative/items/qsgshadereffectsource.cpp +++ b/src/declarative/items/qsgshadereffectsource.cpp @@ -780,12 +780,12 @@ QSGNode *QSGShaderEffectSource::updatePaintNode(QSGNode *oldNode, UpdatePaintNod tex->setLive(m_live); tex->setItem(QSGItemPrivate::get(m_sourceItem)->itemNode()); - QRectF sourceRect = m_sourceRect.isEmpty() + QRectF sourceRect = m_sourceRect.isNull() ? QRectF(0, 0, m_sourceItem->width(), m_sourceItem->height()) : m_sourceRect; tex->setRect(sourceRect); QSize textureSize = m_textureSize.isEmpty() - ? QSize(qCeil(sourceRect.width()), qCeil(sourceRect.height())) + ? QSize(qCeil(qAbs(sourceRect.width())), qCeil(qAbs(sourceRect.height()))) : m_textureSize; tex->setSize(textureSize); tex->setRecursive(m_recursive); diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 001884161b..eb2974f46a 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1740,9 +1740,6 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine qsreal w = ctxt->argument(2).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))); } -- cgit v1.2.3 From 13970487ff78c2794fa2300af33b536968162953 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Thu, 19 May 2011 10:32:41 +0200 Subject: Update unit test according to intended behaviour change. The behaviour was changed in commit 9d7eb51da37e8dffbe284fc564c9b9f08a89bea2. --- tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp index 80d9d9361c..518be896ea 100644 --- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp +++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp @@ -174,7 +174,7 @@ void tst_qdeclarativeqt::rect() QCOMPARE(qvariant_cast(object->property("test2")), QRectF(-10, 13, 100, 109.6)); QCOMPARE(qvariant_cast(object->property("test3")), QRectF()); QCOMPARE(qvariant_cast(object->property("test4")), QRectF()); - QCOMPARE(qvariant_cast(object->property("test5")), QRectF()); + QCOMPARE(qvariant_cast(object->property("test5")), QRectF(10, 13, 100, -109)); delete object; } -- cgit v1.2.3