Fix wrapping bug within inset. dim_.wid was not set!

Add some commented out debug info.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19972 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-09-01 10:30:44 +00:00
parent 5aefefe0cf
commit 087fc75a9d

View File

@ -148,9 +148,10 @@ bool TextMetrics::metrics(MetricsInfo & mi, Dimension & dim)
{ {
BOOST_ASSERT(mi.base.textwidth); BOOST_ASSERT(mi.base.textwidth);
max_width_ = mi.base.textwidth; max_width_ = mi.base.textwidth;
dim_.wid = max_width_;
//lyxerr << "Text::metrics: width: " << mi.base.textwidth lyxerr << "Text::metrics: width: " << mi.base.textwidth
// << " maxWidth: " << max_width_ << "\nfont: " << mi.base.font << endl; << " maxWidth: " << max_width_ << "\nfont: " << mi.base.font << endl;
bool changed = false; bool changed = false;
@ -299,6 +300,9 @@ void TextMetrics::computeRowMetrics(pit_type const pit,
Paragraph const & par = text_->getPar(pit); Paragraph const & par = text_->getPar(pit);
double w = dim_.wid - row.width(); double w = dim_.wid - row.width();
//lyxerr << "\ndim_.wid " << dim_.wid << endl;
//lyxerr << "row.width() " << row.width() << endl;
//lyxerr << "w " << w << endl;
bool const is_rtl = text_->isRTL(buffer, par); bool const is_rtl = text_->isRTL(buffer, par);
if (is_rtl) if (is_rtl)
@ -383,6 +387,8 @@ void TextMetrics::computeRowMetrics(pit_type const pit,
&& !disp_inset && !disp_inset
) { ) {
row.separator = w / ns; row.separator = w / ns;
//lyxerr << "row.separator " << row.separator << endl;
//lyxerr << "ns " << ns << endl;
} else if (is_rtl) { } else if (is_rtl) {
row.x += w; row.x += w;
} }