Code/Editor

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-16 15:56:36 -07:00
parent e6b5342c07
commit 2963739288
51 changed files with 286 additions and 337 deletions
@@ -2476,10 +2476,10 @@ void OutlinerItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem&
auto backgroundBoxRect = option.rect;
backgroundBoxRect.setX(backgroundBoxRect.x() + 0.5);
backgroundBoxRect.setY(backgroundBoxRect.y() + 2.5);
backgroundBoxRect.setWidth(backgroundBoxRect.width() - 1.0);
backgroundBoxRect.setHeight(backgroundBoxRect.height() - 1.0);
backgroundBoxRect.setX(static_cast<int>(backgroundBoxRect.x() + 0.5f));
backgroundBoxRect.setY(static_cast<int>(backgroundBoxRect.y() + 2.5f));
backgroundBoxRect.setWidth(static_cast<int>(backgroundBoxRect.width() - 1.0f));
backgroundBoxRect.setHeight(static_cast<int>(backgroundBoxRect.height() - 1.0f));
const qreal sliceBorderHeight = 0.8f;
@@ -2513,7 +2513,7 @@ void OutlinerItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem&
else
{
auto newRect = option.rect;
newRect.setHeight(newRect.height() - 1.0);
newRect.setHeight(static_cast<int>(newRect.height() - 1.0f));
path.addRect(newRect);
}
@@ -274,8 +274,8 @@ void OutlinerTreeView::drawBranches(QPainter* painter, const QRect& rect, const
// if the item has children offset the drawn line to compensate for drawn expander buttons
bool hasChildren = previousIndex.model()->index(0, 0, previousIndex).isValid();
int horizontalLineY = rect.top() + rectHalfHeight;
int horizontalLineLeft = rect.right() - indentation() * 1.5f;
int horizontalLineRight = hasChildren ? (lineBaseX - indentation()) : (lineBaseX - indentation() * 0.5f);
int horizontalLineLeft = static_cast<int>(rect.right() - indentation() * 1.5f);
int horizontalLineRight = hasChildren ? (lineBaseX - indentation()) : static_cast<int>(lineBaseX - indentation() * 0.5f);
painter->drawLine(horizontalLineLeft, horizontalLineY, horizontalLineRight, horizontalLineY);
}
@@ -284,7 +284,7 @@ void OutlinerTreeView::drawBranches(QPainter* painter, const QRect& rect, const
bool hasNext = previousIndex.sibling(previousIndex.row() + 1, previousIndex.column()).isValid();
if (hasNext || previousIndex == index)
{
int verticalLineX = lineBaseX - indentation() * 1.5f;
int verticalLineX = static_cast<int>(lineBaseX - indentation() * 1.5f);
int verticalLineTop = rect.top();
int verticalLineBottom = hasNext ? rect.bottom() : rect.bottom() - rectHalfHeight;
painter->drawLine(verticalLineX, verticalLineTop, verticalLineX, verticalLineBottom);