equal
deleted
inserted
replaced
112 break; |
112 break; |
113 --it_y; |
113 --it_y; |
114 } |
114 } |
115 } else if (old_height > span->height()) { |
115 } else if (old_height > span->height()) { |
116 //remove the span from all the subspans lists that intersect the columns not covered anymore |
116 //remove the span from all the subspans lists that intersect the columns not covered anymore |
117 Index::iterator it_y = index.lowerBound(-span->bottom()); |
117 Index::iterator it_y = index.lowerBound(-qMax(span->bottom(), span->top())); //qMax usefull if height is 0 |
118 if (it_y == index.end()) |
|
119 it_y = index.find(-span->top()); // This is the only span remaining and we are deleting it. |
|
120 Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list |
118 Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list |
121 while (-it_y.key() <= span->top() + old_height -1) { |
119 while (-it_y.key() <= span->top() + old_height -1) { |
122 if (-it_y.key() > span->bottom()) { |
120 if (-it_y.key() > span->bottom()) { |
123 (*it_y).remove(-span->left()); |
121 int removed = (*it_y).remove(-span->left()); |
|
122 Q_ASSERT(removed == 1); Q_UNUSED(removed); |
124 if (it_y->isEmpty()) { |
123 if (it_y->isEmpty()) { |
125 it_y = index.erase(it_y) - 1; |
124 it_y = index.erase(it_y); |
126 } |
125 } |
127 } |
126 } |
128 if(it_y == index.begin()) |
127 if(it_y == index.begin()) |
129 break; |
128 break; |
130 --it_y; |
129 --it_y; |