Fix: Entity Outliner: Outliner is unusable with the Editor in slice mode (#6983)

* Fixed vertical offset

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* Fixed QPoint

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* Fixed Entry delegate

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* SetRenderHint in Entry delegate

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* Save and restore painter inside the highlighter

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* Restoring Painter

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* Removed comment

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>
This commit is contained in:
Ignacio Martinez
2022-01-19 17:45:52 +01:00
committed by GitHub
parent 667a9df342
commit 65a749494e
5 changed files with 12 additions and 9 deletions
@@ -2599,11 +2599,12 @@ void OutlinerItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem&
optionV4.text.clear();
optionV4.widget->style()->drawControl(QStyle::CE_ItemViewItem, &optionV4, painter);
// Now we setup a Text Document so it can draw the rich text
int verticalOffset = GetEntityNameVerticalOffset(entityId);
painter->translate(textRect.topLeft() + QPoint(0, verticalOffset));
AzToolsFramework::RichTextHighlighter::PaintHighlightedRichText(entityNameRichText, painter, optionV4, textRect);
AzToolsFramework::RichTextHighlighter::PaintHighlightedRichText(
entityNameRichText, painter, optionV4, textRect, QPoint(0, verticalOffset));
painter->restore();
OutlinerListModel::s_paintingName = false;
}