Skip to content
Permalink
Browse files

received all PR suggestions

  • Loading branch information
nastasi-oq committed Mar 11, 2019
1 parent 245e5ba commit ae0e12b1b9c66025df0da56413a14faccbd0918b
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/core/layout/qgslayoutaligner.cpp
@@ -14,8 +14,6 @@
* *
***************************************************************************/

#include <cmath>

#include "qgslayoutaligner.h"
#include "qgslayoutitem.h"
#include "qgslayout.h"
@@ -126,13 +124,16 @@ void QgsLayoutAligner::distributeItems( QgsLayout *layout, const QList<QgsLayout
case DistributeHSpace:
case DistributeVSpace:
// not reachable branch, just to avoid compilation warning
return nan( "" );
return std::numeric_limits<double>::quiet_NaN();
}
// no warnings
return itemBBox.left();
};


double minCoord = std::numeric_limits<double>::max();
double maxCoord = std::numeric_limits<double>::lowest();
QMap< double, QgsLayoutItem * > itemCoords;
for ( QgsLayoutItem *item : items )
{
double refCoord = collectReferenceCoord( item );
@@ -141,7 +142,7 @@ void QgsLayoutAligner::distributeItems( QgsLayout *layout, const QList<QgsLayout
itemCoords.insert( refCoord, item );
}

step = ( maxCoord - minCoord ) / ( items.size() - 1 );
const double step = ( maxCoord - minCoord ) / ( items.size() - 1 );

auto distributeItemToCoord = [layout, distribution]( QgsLayoutItem * item, double refCoord )
{

0 comments on commit ae0e12b

Please sign in to comment.
You can’t perform that action at this time.