From 28cdc759c4e902b858efdc3f1718318ca4cbf380 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 19 Mar 2019 09:22:20 +0100 Subject: Automatically fall back to old text renderer for "clip" word wrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is a word wrap setting in text which expect the text renderer to clip the text to its area. This was missed when implementing the distance field renderer, and in the interest of time we will just automatically fall back to the old text renderer for this mode in 2.3 and then implement a fix in 2.4. Task-number: QT3DS-3138 Change-Id: I027f369e16d9577c6f941a73d7cf398fdb553f64 Reviewed-by: Kimmo Leppälä Reviewed-by: Tomi Korpipää --- src/runtime/q3dsscenemanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/q3dsscenemanager.cpp b/src/runtime/q3dsscenemanager.cpp index dffa07e..5dc37a3 100644 --- a/src/runtime/q3dsscenemanager.cpp +++ b/src/runtime/q3dsscenemanager.cpp @@ -4910,7 +4910,8 @@ Qt3DCore::QEntity *Q3DSSceneManager::buildText(Q3DSTextNode *text3DS, Q3DSLayerN data->entity->setObjectName(QObject::tr("top level text %1").arg(QString::fromUtf8(text3DS->id()))); #if QT_VERSION >= QT_VERSION_CHECK(5,12,2) - if (shouldDistanceFieldRender) { + bool useDistanceFields = shouldDistanceFieldRender && text3DS->wordWrap() != Q3DSTextNode::Clip; + if (useDistanceFields) { data->distanceFieldText = true; data->dropShadow = text3DS->shadow(); QVector2D boundingBox = text3DS->boundingBox(); -- cgit v1.2.3