}
-bool InsetText::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetText::metrics(MetricsInfo & mi, Dimension & dim) const
{
TextMetrics & tm = mi.base.bv->textMetrics(&text_);
// Hand font through to contained lyxtext:
tm.font_ = mi.base.font;
mi.base.textwidth -= 2 * TEXT_TO_INSET_OFFSET;
- tm.metrics(mi, dim);
+ if (hasFixedWidth())
+ tm.metrics(mi, dim, mi.base.textwidth);
+ else
+ tm.metrics(mi, dim);
mi.base.textwidth += 2 * TEXT_TO_INSET_OFFSET;
dim.asc += TEXT_TO_INSET_OFFSET;
dim.des += TEXT_TO_INSET_OFFSET;
dim.wid += 2 * TEXT_TO_INSET_OFFSET;
- bool const changed = dim_ != dim;
- dim_ = dim;
- return changed;
}
TextMetrics & tm = pi.base.bv->textMetrics(&text_);
if (drawFrame_ || pi.full_repaint) {
- int const w = hasFixedWidth() ?
- tm.maxWidth() : tm.width() + 2 * TEXT_TO_INSET_OFFSET;
+ int const w = tm.width() + 2 * TEXT_TO_INSET_OFFSET;
int const yframe = y - TEXT_TO_INSET_OFFSET - tm.ascent();
int const h = tm.height() + 2 * TEXT_TO_INSET_OFFSET;
if (pi.full_repaint)