From c5b947b23c4bd25fd62f8fee4db3d77b7c09bcdc Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Wed, 20 Feb 2002 11:31:32 +0000 Subject: [PATCH] Clear the space around a cells inset also above (Fix for #156). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3573 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 5 +++++ src/insets/insettabular.C | 18 +++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 2ba780ff6e..33f741aab4 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2002-02-20 Juergen Vigna + + * insettabular.C (draw): clear the parts around a cellinset ALWAYS + and also above (was missing). + 2002-02-20 José Matos * insetinclude.h: include_label made string const. diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 2c4163911b..85cbca17e0 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -374,16 +374,18 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline, // Here we use rectangular backgroundColor patches to clean up // within a cell around the cell's red inset box. As follows: // - // +---+ +---+ - // | | | | The rectangles are A, B and C + // +--------------------+ + // | C | The rectangles are A, B and C // | A |------------| B | below, origin top left (tx, ty), // | | inset box | | dimensions w(idth), h(eight). // +---+------------+---+ x grows rightward, y downward // | D | // +--------------------+ // +#if 0 // clear only if we didn't have a change if (bv->text->status() != LyXText::CHANGED_IN_DRAW) { +#endif // clear before the inset int tx, ty, w, h; tx = nx + 1; @@ -409,7 +411,16 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline, h = tabular->GetDescentOfRow(i) - the_locking_inset->descent(bv, font) - 1; pain.fillRectangle(tx, ty, w, h, backgroundColor()); + // clear above the inset + tx = nx + 1; + ty = baseline - tabular->GetAscentOfRow(i) + 1; + w = tabular->GetWidthOfColumn(cell) - + tabular->GetAdditionalWidth(cell) - 1; + h = tabular->GetAscentOfRow(i) - the_locking_inset->ascent(bv, font); + pain.fillRectangle(tx, ty, w, h, backgroundColor()); +#if 0 } +#endif } x -= ADD_TO_TABULAR_WIDTH; x += width(bv, font); @@ -648,9 +659,6 @@ bool InsetTabular::lockInsetInInset(BufferView * bv, UpdatableInset * inset) if (in->getInsetFromID(id)) { actcell = i; in->edit(bv); -// the_locking_inset = in; -// locked = true; -// resetPos(bv); return the_locking_inset->lockInsetInInset(bv, inset); } } -- 2.39.2