From 4cd61f7127566ea95d9088e36fc1202a0ef7da3a Mon Sep 17 00:00:00 2001 From: Noah Davis Date: Mon, 30 Aug 2021 05:44:09 -0400 Subject: [PATCH] kstyle: use slightly more than 1px for pen widths QPainter does not render lines that are exactly 1px very well. The only fix is to use slightly more than 1px. --- kstyle/breezemetrics.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kstyle/breezemetrics.h b/kstyle/breezemetrics.h index 35202f36..9425b07f 100644 --- a/kstyle/breezemetrics.h +++ b/kstyle/breezemetrics.h @@ -17,17 +17,18 @@ namespace Breeze { /* Using 1 instead of slightly more than 1 causes symbols drawn with * pen strokes to look skewed. The exact amount added does not matter - * as long as it isn't too visible. + * as long as it isn't too visible. Even with QPen::setCosmetic(true), + * 1px pen widths still look slightly worse. */ // The standard pen stroke width for symbols. - static constexpr qreal Symbol = 1.01; + static constexpr qreal Symbol = 1.001; // The standard pen stroke width for frames. - static constexpr int Frame = 1; + static constexpr qreal Frame = 1.001; // The standard pen stroke width for shadows. - static constexpr int Shadow = 1; - + static constexpr qreal Shadow = 1.001; + // A value for pen width arguments to make it clear that there is no pen stroke static constexpr int NoPen = 0; };