]> git.lyx.org Git - features.git/commitdiff
Clear the space around a cells inset also above (Fix for #156).
authorJürgen Vigna <jug@sad.it>
Wed, 20 Feb 2002 11:31:32 +0000 (11:31 +0000)
committerJürgen Vigna <jug@sad.it>
Wed, 20 Feb 2002 11:31:32 +0000 (11:31 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3573 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insettabular.C

index 2ba780ff6e7b19384f7f8efa8c157fd6be845dc4..33f741aab49a25c3c03621cea058d597d6b98a15 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-20  Juergen Vigna  <jug@sad.it>
+
+       * insettabular.C (draw): clear the parts around a cellinset ALWAYS
+       and also above (was missing).
+
 2002-02-20  José Matos  <jamatos@fep.up.pt>
 
        * insetinclude.h: include_label made string const.
index 2c4163911bb5c19501d9cc732d15898d0dcfa935..85cbca17e06e38f747b700c94ec9674736c0706f 100644 (file)
@@ -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);
                        }
                }