]> git.lyx.org Git - lyx.git/commitdiff
Inset coords shall not be recorded in Inset::draw() because this can create problems...
authorAbdelrazak Younes <younes@lyx.org>
Thu, 20 Sep 2007 10:58:38 +0000 (10:58 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 20 Sep 2007 10:58:38 +0000 (10:58 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20376 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetCommand.cpp
src/insets/InsetExternal.cpp
src/insets/InsetFlex.cpp
src/insets/InsetGraphics.cpp
src/insets/InsetInclude.cpp
src/insets/InsetQuotes.cpp
src/insets/InsetTabular.cpp
src/insets/InsetVSpace.cpp

index a97b84d2ab7a3ac8f178a782172f7d94c8893175..0eb616b423d3a574bdb631c965b288c278d4e2a0 100644 (file)
@@ -71,7 +71,6 @@ bool InsetCommand::setMouseHover(bool mouse_hover)
 
 void InsetCommand::draw(PainterInfo & pi, int x, int y) const
 {
-       setPosCache(pi, x, y);
        button_.setRenderState(mouse_hover_);
        button_.draw(pi, x, y);
 }
index ef9afad5f20386d284a0a643a7c0f738dba7bcfa..547e0c180eeb36f8ab419e92a45f2ac34b8d9caf 100644 (file)
@@ -517,7 +517,6 @@ bool InsetExternal::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetExternal::draw(PainterInfo & pi, int x, int y) const
 {
-       setPosCache(pi, x, y);
        renderer_->draw(pi, x, y);
 }
 
index 4ef9581353b9e36969c19a170285503ede8d5df5..47f270cf879f44bae71467c39c79c8b6043218d6 100644 (file)
@@ -110,8 +110,6 @@ bool InsetFlex::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetFlex::draw(PainterInfo & pi, int x, int y) const
 {
-       setPosCache(pi, x, y);
-
        Font tmpfont = pi.base.font;
        getDrawFont(pi.base.font);
        // I don't understand why the above .reduce and .realize aren't
index b75fc82def1a429b6eb50ca04797f0b6694c981b..e3d0fcca2add9e2bc9e90791a213e568d09915f0 100644 (file)
@@ -268,7 +268,6 @@ bool InsetGraphics::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetGraphics::draw(PainterInfo & pi, int x, int y) const
 {
-       setPosCache(pi, x, y);
        graphic_->draw(pi, x, y);
 }
 
index 136c461aac9302ca946ad73ccea5fb992e7e8462..b1c9a7cbd6066a4261bf993a42042d927b4ea2ab 100644 (file)
@@ -816,8 +816,6 @@ bool InsetInclude::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetInclude::draw(PainterInfo & pi, int x, int y) const
 {
-       setPosCache(pi, x, y);
-
        BOOST_ASSERT(pi.base.bv);
 
        bool use_preview = false;
index 994d0436ec63d6093be176cb38f3bffe7618adcb..fa2558150fff1829debd9b6e6d5191e1698a5b0a 100644 (file)
@@ -263,7 +263,6 @@ void InsetQuotes::draw(PainterInfo & pi, int x, int y) const
        } else {
                pi.pain.text(x, y, text, pi.base.font);
        }
-       setPosCache(pi, x, y);
 }
 
 
index 47c50de74f72e328714187e9b4f3e760640b3b44..285abd2881b3edd7ef4daa464a63275664c2acb1 100644 (file)
@@ -2994,8 +2994,6 @@ bool InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetTabular::draw(PainterInfo & pi, int x, int y) const
 {
-       setPosCache(pi, x, y);
-
        //lyxerr << "InsetTabular::draw: " << x << " " << y << endl;
        BufferView * bv = pi.base.bv;
 
@@ -3022,6 +3020,8 @@ void InsetTabular::draw(PainterInfo & pi, int x, int y) const
                                first_visible_cell = idx;
 
                        int const cx = nx + tabular.getBeginningOfTextInCell(idx);
+                       // Cache the Inset position.
+                       bv->coordCache().insets().add(cell(idx).get(), cx, y);
                        if (nx + tabular.columnWidth(idx) < 0
                            || nx > bv->workWidth()
                            || y + d < 0
@@ -3047,8 +3047,6 @@ void InsetTabular::draw(PainterInfo & pi, int x, int y) const
 
 void InsetTabular::drawSelection(PainterInfo & pi, int x, int y) const
 {
-       setPosCache(pi, x, y);
-
        Cursor & cur = pi.base.bv->cursor();
 
        x += scx_ + ADD_TO_TABULAR_WIDTH;
index 4138a66195fcb7b0859f1341122a754925ae4234..43c3bc3d24830b20db64946bebb4f27aa02d22b2 100644 (file)
@@ -146,8 +146,6 @@ bool InsetVSpace::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetVSpace::draw(PainterInfo & pi, int x, int y) const
 {
-       setPosCache(pi, x, y);
-
        x += ADD_TO_VSPACE_WIDTH;
 
        int const start = y - dim_.asc;