Merge branch 'qtquick2' of scm.dev.nokia.troll.no:qt/qtdeclarative-staging into qtquick2

This commit is contained in:
Alan Alpert 2011-05-19 18:43:59 +10:00
commit 56d80e1590
3 changed files with 3 additions and 6 deletions

View File

@ -780,12 +780,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.isEmpty() QRectF sourceRect = m_sourceRect.isNull()
? 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(sourceRect.width()), qCeil(sourceRect.height())) ? QSize(qCeil(qAbs(sourceRect.width())), qCeil(qAbs(sourceRect.height())))
: m_textureSize; : m_textureSize;
tex->setSize(textureSize); tex->setSize(textureSize);
tex->setRecursive(m_recursive); tex->setRecursive(m_recursive);

View File

@ -1740,9 +1740,6 @@ 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)));
} }

View File

@ -174,7 +174,7 @@ void tst_qdeclarativeqt::rect()
QCOMPARE(qvariant_cast<QRectF>(object->property("test2")), QRectF(-10, 13, 100, 109.6)); QCOMPARE(qvariant_cast<QRectF>(object->property("test2")), QRectF(-10, 13, 100, 109.6));
QCOMPARE(qvariant_cast<QRectF>(object->property("test3")), QRectF()); QCOMPARE(qvariant_cast<QRectF>(object->property("test3")), QRectF());
QCOMPARE(qvariant_cast<QRectF>(object->property("test4")), QRectF()); QCOMPARE(qvariant_cast<QRectF>(object->property("test4")), QRectF());
QCOMPARE(qvariant_cast<QRectF>(object->property("test5")), QRectF()); QCOMPARE(qvariant_cast<QRectF>(object->property("test5")), QRectF(10, 13, 100, -109));
delete object; delete object;
} }