]> git.lyx.org Git - features.git/commitdiff
Don't draw if there's nothing to draw.
authorAbdelrazak Younes <younes@lyx.org>
Tue, 28 Aug 2007 18:05:55 +0000 (18:05 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 28 Aug 2007 18:05:55 +0000 (18:05 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19866 a592a061-630c-0410-9148-cb99ea01b6c8

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();