File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -301,7 +301,9 @@ QgsComposerLegend::LegendSize QgsComposerLegend::paintAndDetermineSize( QPainter
301
301
{
302
302
double currentYCoord = mBoxSpace ;
303
303
304
- // center if we stay in totalWidth, otherwise allign to left and expand total width
304
+ // For multicolumn center if we stay in totalWidth, otherwise allign to left
305
+ // and expand total width. With single column keep alligned to left be cause
306
+ // it looks better alligned with items bellow instead of centered
305
307
Qt::AlignmentFlag halignement;
306
308
if ( mColumnCount > 1 && currentPosition.titleSize .width () + 2 * mBoxSpace < totalWidth )
307
309
{
@@ -310,7 +312,7 @@ QgsComposerLegend::LegendSize QgsComposerLegend::paintAndDetermineSize( QPainter
310
312
else
311
313
{
312
314
halignement = Qt::AlignLeft;
313
- totalWidth = currentPosition.titleSize .width () + 2 * mBoxSpace ;
315
+ totalWidth = qMax ( currentPosition.titleSize .width () + 2 * mBoxSpace , totalWidth ) ;
314
316
}
315
317
316
318
if ( painter ) painter->setPen ( QColor ( 0 , 0 , 0 ) );
You can’t perform that action at this time.
0 commit comments