]> git.lyx.org Git - features.git/commitdiff
Fix a missing metrics update when clicking within a previewed formula.
authorAbdelrazak Younes <younes@lyx.org>
Fri, 13 Apr 2007 11:35:11 +0000 (11:35 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 13 Apr 2007 11:35:11 +0000 (11:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17794 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathHull.C
src/mathed/InsetMathNest.C

index 579bafdb817ca0bf8ce0f6197fa0357bd2e7a679..ce4cb769ad29093f9b3d4050ce151f5c77b42169 100644 (file)
@@ -1318,6 +1318,10 @@ void InsetMathHull::edit(LCursor & cur, bool left)
 {
        cur.push(*this);
        left ? idxFirst(cur) : idxLast(cur);
+       // The inset formula dimension is not necessarily the same as the
+       // so we have to indicate to the BufferView that a metrics update
+       // is needed. 
+       cur.updateFlags(Update::Force);
 }
 
 
index 335bf232b0ebbb806738115209c4ac77a9b32d46..549b56f70f1fd03c7d81d4c44f2da29507f94f73 100644 (file)
@@ -1147,9 +1147,14 @@ void InsetMathNest::lfunMousePress(LCursor & cur, FuncRequest & cmd)
        if (cmd.button() == mouse_button::button1) {
                //lyxerr << "## lfunMousePress: setting cursor to: " << cur << endl;
                bv.mouseSetCursor(cur);
-               // FIXME: we have to enable full redraw here because of the
-               // visual box corners that define the inset.
-               cur.updateFlags(Update::Decoration | Update::FitCursor);
+               // Update the cursor update flags as needed:
+               //
+               // Update::Decoration: tells to update the decoration (visual box
+               //                     corners that define the inset)/
+               // Update::FitCursor: adjust the screen to the cursor position if
+               //                    needed
+               // cur.result().update(): don't overwrite previously set flags.
+               cur.updateFlags(Update::Decoration | Update::FitCursor | cur.result().update());
        } else if (cmd.button() == mouse_button::button2) {
                MathArray ar;
                if (cap::selection()) {