Commit 2b7904e9 authored by Noah Davis's avatar Noah Davis 🌵
Browse files

Remove duplicated code in overloaded strokedRect function

parent bda1b374
......@@ -1488,7 +1488,7 @@ namespace Breeze
}
//______________________________________________________________________________
QRectF Helper::strokedRect( const QRect &rect, const int penWidth ) const
QRectF Helper::strokedRect( const QRectF &rect, const int penWidth ) const
{
/* With a pen stroke width of 1, the rectangle should have each of its
* sides moved inwards by half a pixel. This allows the stroke to be
......@@ -1500,10 +1500,9 @@ namespace Breeze
return QRectF( rect ).adjusted( adjustment, adjustment, -adjustment, -adjustment );
}
QRectF Helper::strokedRect( const QRectF &rect, const int penWidth ) const
QRectF Helper::strokedRect( const QRect &rect, const int penWidth ) const
{
qreal adjustment = 0.5 * penWidth;
return rect.adjusted( adjustment, adjustment, -adjustment, -adjustment );
return strokedRect(QRectF(rect), penWidth);
}
//______________________________________________________________________________
......
......@@ -315,10 +315,10 @@ namespace Breeze
{ return qMax( qreal( Metrics::Frame_FrameRadius ) - 0.5 + bias, 0.0 ); }
//* return a QRectF with the appropriate size for a rectangle with a pen stroke
QRectF strokedRect( const QRect &rect, const int penWidth = 1 ) const;
QRectF strokedRect( const QRectF &rect, const int penWidth = 1 ) const;
//* return a QRectF with the appropriate size for a rectangle with a pen stroke
QRectF strokedRect( const QRectF &rect, const int penWidth = 1 ) const;
QRectF strokedRect( const QRect &rect, const int penWidth = 1 ) const;
protected:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment