From ebf753d0ee017edc2b3a3f9b26347466fe4c0589 Mon Sep 17 00:00:00 2001 From: Lu YaNing Date: Wed, 4 Nov 2020 10:17:33 +0800 Subject: Fix qstylesheetstyle clip border error The left border path clip error when border size is odd. That because borderClip calc path with border with divide 2. It should be 2.0 that make result to accurately real number. Pick-to: 5.15 Change-Id: I8c6f358afa4f3c8c9e5b263707ee145f6e5491c0 Reviewed-by: David Faure Reviewed-by: Giuseppe D'Angelo Reviewed-by: Volker Hilsheimer --- src/widgets/styles/qstylesheetstyle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 3a27d5b240..407134298b 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -1339,11 +1339,11 @@ QPainterPath QRenderRule::borderClip(QRect r) path.lineTo(rect.x() + blr.width(), curY); curX = rect.left() + borders[LeftEdge]/2.0; - path.arcTo(curX, rect.bottom() - 2*blr.height() + borders[BottomEdge]/2, + path.arcTo(curX, rect.bottom() - 2*blr.height() + borders[BottomEdge]/2.0, blr.width()*2 - borders[LeftEdge], blr.height()*2 - borders[BottomEdge], 270, -90); path.lineTo(curX, rect.top() + tlr.height()); - path.arcTo(curX, rect.top() + borders[TopEdge]/2, + path.arcTo(curX, rect.top() + borders[TopEdge]/2.0, tlr.width()*2 - borders[LeftEdge], tlr.height()*2 - borders[TopEdge], 180, -90); path.closeSubpath(); -- cgit v1.2.3