]> git.lyx.org Git - lyx.git/blobdiff - src/TextMetrics.cpp
Don't draw if there's nothing to draw.
[lyx.git] / src / TextMetrics.cpp
index dc9499849f4bcdc4c24181c436233ccd70987b98..508d2088fb2069888c6394c34d8d6314d450a507 100644 (file)
@@ -965,6 +965,8 @@ int TextMetrics::singleWidth(pit_type pit, pos_type pos) const
 // only used for inset right now. should also be used for main text
 void TextMetrics::draw(PainterInfo & pi, int x, int y) const
 {
+       if (par_metrics_.empty())
+               return;
        ParMetricsCache::const_iterator it = par_metrics_.begin();
        ParMetricsCache::const_iterator const end = par_metrics_.end();
        y -= it->second.ascent();