Don't draw if there's nothing to draw.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19866 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-08-28 18:05:55 +00:00
parent 1a57b660a1
commit 0e7ef480f7

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