mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Avoid drawing clipped section labels
This commit is contained in:
parent
1ef87a401d
commit
392d377713
@ -60,6 +60,12 @@ void QgsLayoutReportSectionLabel::paint( QPainter *painter, const QStyleOptionGr
|
||||
QRectF r = rect();
|
||||
QRectF scaledRect( r.left() / scaleValue, r.top() / scaleValue, r.width() / scaleValue, r.height() / scaleValue );
|
||||
|
||||
if ( scaledRect.width() < s.width() + 2 * margin || scaledRect.height() < s.height() + 2 * margin )
|
||||
{
|
||||
// zoomed out too far to fully draw label inside item rect
|
||||
return;
|
||||
}
|
||||
|
||||
QRectF textRect = QRectF( scaledRect.left() + margin, scaledRect.top() + margin, scaledRect.width() - 2 * margin, scaledRect.height() - 2 * margin );
|
||||
QRectF boxRect = QRectF( scaledRect.left(), scaledRect.bottom() - ( s.height() + 2 * margin ), s.width() + 2 * margin, s.height() + 2 * margin );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user