mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-08 10:51:03 +00:00
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:
parent
9d00e2ec0a
commit
21f59b816b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user