From 3c3ebc68285e1a0d5a11cd202b9d0042e948394c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Fri, 28 Jul 2000 14:59:26 +0000 Subject: [PATCH] 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 --- src/insets/insettabular.C | 4 ++-- src/insets/insettext.C | 21 ++++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) 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); } -- 2.39.2