From 008287fd3dd29969fa060586e0866c3198edbbbe Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 13 Apr 2007 11:35:11 +0000 Subject: [PATCH] Fix a missing metrics update when clicking within a previewed formula. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17794 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathHull.C | 4 ++++ src/mathed/InsetMathNest.C | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/mathed/InsetMathHull.C b/src/mathed/InsetMathHull.C index 579bafdb81..ce4cb769ad 100644 --- a/src/mathed/InsetMathHull.C +++ b/src/mathed/InsetMathHull.C @@ -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); } diff --git a/src/mathed/InsetMathNest.C b/src/mathed/InsetMathNest.C index 335bf232b0..549b56f70f 100644 --- a/src/mathed/InsetMathNest.C +++ b/src/mathed/InsetMathNest.C @@ -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()) { -- 2.39.2