##// 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 // If the items would occupy more space than is available, start truncating them
158 // If the items would occupy more space than is available, start truncating them
159 // from the longest one.
159 // from the longest one.
160 qreal availableGeometry = geometry.width() - right - left * 2 - itemMargins;
160 qreal availableGeometry = geometry.width() - right - left * 2 - itemMargins;
161 if (markerItemsWidth >= availableGeometry && legendWidthList.count() > 1) {
161 if (markerItemsWidth >= availableGeometry) {
162 bool truncated(false);
162 bool truncated(false);
163 int count = legendWidthList.count();
163 int count = legendWidthList.count();
164 for (int i = 1; i < count; i++) {
164 for (int i = 1; i < count; i++) {
@@ -193,7 +193,8 void LegendLayout::setAttachedGeometry(const QRectF &rect)
193 if (truncated)
193 if (truncated)
194 break;
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 while (markerItemsWidth >= availableGeometry) {
198 while (markerItemsWidth >= availableGeometry) {
198 for (int i = 0; i < count; i++) {
199 for (int i = 0; i < count; i++) {
199 legendWidthList.at(i)->width--;
200 legendWidthList.at(i)->width--;
General Comments 0
You need to be logged in to leave comments. Login now