RenderGraphic::metrics(): return early.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25164 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-06-06 12:34:27 +00:00
parent 9d00e2ec0a
commit 21f59b816b

View File

@ -135,12 +135,16 @@ void RenderGraphic::metrics(MetricsInfo & mi, Dimension & dim) const
{
bool image_ready = displayGraphic(params_) && readyToDisplay(loader_);
if (image_ready) {
dim.wid = loader_.image()->width() + 2 * Inset::TEXT_TO_INSET_OFFSET;
dim.asc = loader_.image()->height();
dim_ = dim;
return;
}
dim.asc = image_ready ? loader_.image()->height() : 50;
dim.des = 0;
if (image_ready) {
dim.wid = loader_.image()->width() + 2 * Inset::TEXT_TO_INSET_OFFSET;
} else {
int font_width = 0;
FontInfo msgFont(mi.base.font);
@ -161,7 +165,6 @@ void RenderGraphic::metrics(MetricsInfo & mi, Dimension & dim) const
}
dim.wid = max(50, font_width + 15);
}
dim_ = dim;
}