##// END OF EJS Templates
Fix signle legend truncation...
Titta Heikkala -
r2665:e045f46957d9
parent child
Show More
@@ -158,7 +158,7 void LegendLayout::setAttachedGeometry(const QRectF &rect)
158 158 // If the items would occupy more space than is available, start truncating them
159 159 // from the longest one.
160 160 qreal availableGeometry = geometry.width() - right - left * 2 - itemMargins;
161 if (markerItemsWidth >= availableGeometry && legendWidthList.count() > 1) {
161 if (markerItemsWidth >= availableGeometry) {
162 162 bool truncated(false);
163 163 int count = legendWidthList.count();
164 164 for (int i = 1; i < count; i++) {
@@ -193,7 +193,8 void LegendLayout::setAttachedGeometry(const QRectF &rect)
193 193 if (truncated)
194 194 break;
195 195 }
196 // Items are of same width and all of them need to be truncated.
196 // Items are of same width and all of them need to be truncated
197 // or there is just one item that is truncated.
197 198 while (markerItemsWidth >= availableGeometry) {
198 199 for (int i = 0; i < count; i++) {
199 200 legendWidthList.at(i)->width--;
General Comments 0
You need to be logged in to leave comments. Login now