// the singlePar optimisation.
return false;
+ tm.updatePosCache(bottom_pit);
d->update_strategy_ = SingleParUpdate;
LYXERR(Debug::PAINTING, "\ny1: " << pm.position() - pm.ascent()
}
}
anchor_pm.setPosition(d->anchor_ypos_);
+ tm.updatePosCache(d->anchor_pit_);
LYXERR(Debug::PAINTING, "metrics: "
<< " anchor pit = " << d->anchor_pit_
y1 -= pm.descent();
// Save the paragraph position in the cache.
pm.setPosition(y1);
+ tm.updatePosCache(pit1);
y1 -= pm.ascent();
}
y2 += pm.ascent();
// Save the paragraph position in the cache.
pm.setPosition(y2);
+ tm.updatePosCache(pit2);
y2 += pm.descent();
}
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
+#include "frontends/NullPainter.h"
#include "support/debug.h"
#include "support/lassert.h"
}
+void TextMetrics::updatePosCache(pit_type pit) const
+{
+ frontend::NullPainter np;
+ PainterInfo pi(bv_, np);
+ drawParagraph(pi, pit, origin_.x_, par_metrics_[pit].position());
+}
+
+
int TextMetrics::rightMargin(ParagraphMetrics const & pm) const
{
return text_->isMainText() ? pm.rightMargin(*bv_) : 0;
redoParagraph(pit);
par_metrics_[pit].setPosition(last.second.position()
+ last.second.descent() + par_metrics_[pit].ascent());
+ updatePosCache(pit);
}
redoParagraph(pit);
par_metrics_[pit].setPosition(first.second.position()
- first.second.ascent() - par_metrics_[pit].descent());
+ updatePosCache(pit);
}
// y is screen coordinate
///
void newParMetricsUp();
+ /// The "nodraw" drawing stage for one single paragraph: set the
+ /// positions of the insets contained this paragraph in metrics
+ /// cache. Related to BufferView::updatePosCache.
+ void updatePosCache(pit_type pit) const;
+
/// Gets the fully instantiated font at a given position in a paragraph
/// Basically the same routine as Paragraph::getFont() in Paragraph.cpp.
/// The difference is that this one is used for displaying, and thus we