Skip to content

Commit

Permalink
fix: DArrowRectangle left/right style incorrect
Browse files Browse the repository at this point in the history
radiusArrowStyleEnable 后 border 少了一些绘制路径

Issue: linuxdeepin/dtk#92
  • Loading branch information
kegechen committed Nov 9, 2023
1 parent b15940d commit 74b3762
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/widgets/darrowrectangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ QPainterPath DArrowRectanglePrivate::getLeftCornerPath()
border.arcTo(bottomRight.x() - 2 * radius, bottomRight.y() - 2 * radius, 2 * radius, 2 * radius, 0, -90);

if (radiusArrowStyleEnable) {
border.lineTo(bottomLeft.x() + arrowWidth, bottomLeft.y());
border.lineTo(bottomLeft.x() + radius, bottomLeft.y());
border.arcTo(bottomLeft.x(), bottomLeft.y() - widgetRadius, widgetRadius, widgetRadius, -90, -90);
border.lineTo(bottomLeft.x(), cornerPoint.y() + m_arrowWidth / 2 + radius / 2);

Expand All @@ -818,9 +818,11 @@ QPainterPath DArrowRectanglePrivate::getLeftCornerPath()

border.lineTo(topLeft.x(), cornerPoint.y() - m_arrowWidth / 2 - radius / 2);
border.arcTo(topLeft.x(), topLeft.y(), widgetRadius, widgetRadius, -180, -90);

border.lineTo(topLeft.x() + radius, topLeft.y());
} else {
if (leftRightRadius) {
border.lineTo(bottomLeft.x() + arrowWidth, bottomLeft.y());
border.lineTo(bottomLeft.x() + radius, bottomLeft.y());
border.arcTo(bottomLeft.x(), bottomLeft.y() - widgetRadius, widgetRadius, widgetRadius, -90, -90);
border.lineTo(bottomLeft.x(), cornerPoint.y() + m_arrowWidth / 2);
} else {
Expand Down Expand Up @@ -900,6 +902,8 @@ QPainterPath DArrowRectanglePrivate::getRightCornerPath()

border.lineTo(bottomRight.x(), cornerPoint.y() + m_arrowWidth / 2 + radius / 2);
border.arcTo(bottomRight.x() - widgetRadius, bottomRight.y() - widgetRadius, widgetRadius, widgetRadius, 0, -90);

border.lineTo(bottomRight.x() - radius, bottomRight.y());
} else {
if (leftRightRadius) {
border.lineTo(topRight.x() - radius, topRight.y());
Expand Down

0 comments on commit 74b3762

Please sign in to comment.