Fixes issue with painters being saved and not restored in some cases, which would print numerous warnings in the VS console. (#7296)

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
monroegm-disable-blank-issue-2
Danilo Aimini 4 years ago committed by GitHub
parent 2dbc961ea8
commit e1c7dce7a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -306,11 +306,8 @@ namespace AzToolsFramework
{ {
// Only show the close icon if the prefab is expanded. // Only show the close icon if the prefab is expanded.
// This allows the prefab container to be opened if it was collapsed during propagation. // This allows the prefab container to be opened if it was collapsed during propagation.
if (!isExpanded) if (isExpanded)
{ {
return;
}
// Use the same color as the background. // Use the same color as the background.
QColor backgroundColor = m_backgroundColor; QColor backgroundColor = m_backgroundColor;
if (isSelected) if (isSelected)
@ -331,17 +328,16 @@ namespace AzToolsFramework
QIcon closeIcon = QIcon(m_prefabEditCloseIconPath); QIcon closeIcon = QIcon(m_prefabEditCloseIconPath);
painter->drawPixmap(option.rect.topLeft() + offset, closeIcon.pixmap(iconSize)); painter->drawPixmap(option.rect.topLeft() + offset, closeIcon.pixmap(iconSize));
} }
}
else else
{ {
// Only show the edit icon on hover. // Only show the edit icon on hover.
if (!isHovered) if (isHovered)
{ {
return;
}
QIcon openIcon = QIcon(m_prefabEditOpenIconPath); QIcon openIcon = QIcon(m_prefabEditOpenIconPath);
painter->drawPixmap(option.rect.topLeft() + offset, openIcon.pixmap(iconSize)); painter->drawPixmap(option.rect.topLeft() + offset, openIcon.pixmap(iconSize));
} }
}
painter->restore(); painter->restore();
} }

Loading…
Cancel
Save