width_ = width;
height_ = height;
- // The complete text metrics will be redone.
- text_metrics_.clear();
updateMetrics(false);
}
void BufferView::updateMetrics(bool singlepar)
{
Text & buftext = buffer_.text();
- TextMetrics & tm = textMetrics(&buftext);
pit_type size = int(buftext.paragraphs().size());
if (anchor_ref_ > int(buftext.paragraphs().size() - 1)) {
// Clear out paragraph metrics to avoid having invalid metrics
// in the cache from paragraphs not relayouted below
- tm.clear();
+ // The complete text metrics will be redone.
+ text_metrics_.clear();
}
+ TextMetrics & tm = textMetrics(&buftext);
+
// If the paragraph metrics has changed, we can not
// use the singlepar optimisation.
if (singlepar