From: Jürgen Vigna Date: Fri, 28 Jul 2000 14:59:26 +0000 (+0000) Subject: A really small fix for alignment in tabular cells of multirow text-insets. X-Git-Tag: 1.6.10~22070 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=3c3ebc68285e1a0d5a11cd202b9d0042e948394c;p=features.git A really small fix for alignment in tabular cells of multirow text-insets. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@937 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 1c179ca833..832b8b119d 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -1546,8 +1546,8 @@ int InsetTabular::getMaxWidth(Painter & pain, return -1; int w = GetMaxWidthOfCell(pain, cell); if (w > 0) - // because the inset then subtracts it's top_x - w += inset->x(); + // because the inset then subtracts it's top_x and owner->x() + w += (inset->x() - top_x); return w; } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 2d69f911a3..c17982140e 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -233,15 +233,7 @@ int InsetText::width(BufferView * bv, LyXFont const &) const int InsetText::textWidth(Painter & pain) const { int w = getMaxWidth(pain, this); - if (w < 0) { - return w; - } - if (owner()) { - w = w - top_x + owner()->x(); - return w; - } - w -= (2 * TEXT_TO_INSET_OFFSET); - return w - top_x; + return w; } @@ -1207,9 +1199,16 @@ bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y, int InsetText::getMaxWidth(Painter & pain, UpdatableInset const * inset) const { int w = UpdatableInset::getMaxWidth(pain, inset); - if (w < 0) + if (w < 0) { + return w; + } + if (owner()) { + w = w - top_x + owner()->x(); return w; - return w - (2*TEXT_TO_INSET_OFFSET); + } + w -= (2 * TEXT_TO_INSET_OFFSET); + return w - top_x; +// return w - (2*TEXT_TO_INSET_OFFSET); }