From 319abafb0dd4c0e9e3966e87a87c79bc5b07d224 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Tue, 21 May 2024 16:08:40 +0200 Subject: [PATCH 1/2] bad shadowColor check fixed --- src/nodes/QskArcNode.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/nodes/QskArcNode.cpp b/src/nodes/QskArcNode.cpp index e3de5c0a..737bb164 100644 --- a/src/nodes/QskArcNode.cpp +++ b/src/nodes/QskArcNode.cpp @@ -120,8 +120,9 @@ void QskArcNode::setArcData( const QRectF& rect, const QskArcMetrics& arcMetrics } const auto isFillNodeVisible = gradient.isVisible() && !metricsArc.isNull(); - const auto isStrokeNodeVisible = borderWidth > 0.0 && borderColor.alpha() > 0; - const auto isShadowNodeVisible = shadowColor.alpha() > 0.0 && isFillNodeVisible; + const auto isStrokeNodeVisible = ( borderWidth > 0.0 ) && ( borderColor.alpha() > 0 ); + const auto isShadowNodeVisible = isFillNodeVisible && + shadowColor.isValid() && ( shadowColor.alpha() > 0.0 ); const auto path = metricsArc.painterPath( arcRect ); @@ -188,7 +189,7 @@ void QskArcNode::setArcData( const QRectF& rect, const QskArcMetrics& arcMetrics borderNode = nullptr; } - qskUpdateChildren(this, ShadowRole, shadowNode); - qskUpdateChildren(this, FillRole, fillNode); - qskUpdateChildren(this, BorderRole, borderNode); + qskUpdateChildren( this, ShadowRole, shadowNode ); + qskUpdateChildren( this, FillRole, fillNode ); + qskUpdateChildren( this, BorderRole, borderNode ); } From 2164e8631085eab3571d31d87f14110dde31b3f6 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Mon, 3 Jun 2024 13:18:41 +0200 Subject: [PATCH 2/2] using qreal instead of double --- src/nodes/QskVertex.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/nodes/QskVertex.h b/src/nodes/QskVertex.h index 0d928a84..540d8ffe 100644 --- a/src/nodes/QskVertex.h +++ b/src/nodes/QskVertex.h @@ -26,7 +26,7 @@ namespace QskVertex Color( QRgb ) noexcept; Color( const QColor& ); - Color interpolatedTo( Color, double ratio ) const noexcept; + Color interpolatedTo( Color, qreal ratio ) const noexcept; constexpr bool operator==( const Color& ) const noexcept; constexpr bool operator!=( const Color& ) const noexcept; @@ -60,7 +60,7 @@ namespace QskVertex if ( a < 255 ) { - const double af = a / 255.0; + const auto af = a / 255.0; r *= af; g *= af; @@ -214,15 +214,15 @@ namespace QskVertex m_stepIndex = 0; m_stepCount = stepCount; - const double angleStep = M_PI_2 / stepCount; + const auto angleStep = M_PI_2 / stepCount; m_cosStep = qFastCos( angleStep ); m_sinStep = qFastSin( angleStep ); } inline bool isInverted() const { return m_inverted; } - inline double cos() const { return m_cos; } - inline double sin() const { return m_inverted ? -m_sin : m_sin; } + inline qreal cos() const { return m_cos; } + inline qreal sin() const { return m_inverted ? -m_sin : m_sin; } inline int step() const { return m_stepIndex; } inline int stepCount() const { return m_stepCount; } @@ -253,7 +253,7 @@ namespace QskVertex } else { - const double cos0 = m_cos; + const auto cos0 = m_cos; m_cos = m_cos * m_cosStep + m_sin * m_sinStep; m_sin = m_sin * m_cosStep - cos0 * m_sinStep; @@ -269,9 +269,9 @@ namespace QskVertex inline void operator++() { increment(); } - static int segmentHint( double radius ) + static int segmentHint( qreal radius ) { - const double arcLength = radius * M_PI_2; + const auto arcLength = radius * M_PI_2; return qBound( 3, qCeil( arcLength / 3.0 ), 18 ); // every 3 pixels } @@ -292,12 +292,12 @@ namespace QskVertex } private: - double m_cos; - double m_sin; + qreal m_cos; + qreal m_sin; int m_stepIndex; - double m_cosStep; - double m_sinStep; + qreal m_cosStep; + qreal m_sinStep; int m_stepCount; bool m_inverted;