]> git.lyx.org Git - features.git/commitdiff
Regenerate a preview only when leaving a math inset with depth 1.
authorAngus Leeming <leeming@lyx.org>
Tue, 23 Jul 2002 14:47:31 +0000 (14:47 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 23 Jul 2002 14:47:31 +0000 (14:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4763 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/math_nestinset.C

index 3da70dd6730ff027ca6ba40d327c6842fae633d5..306f2f372de18f263f0efa5832cc648c376b4e6a 100644 (file)
@@ -3,6 +3,9 @@
        * formula.C (descent): add an arbitrary 12 pixels to the descent when
        previewing a display mode equation, analogous to AndrĂ©'s code elsewhere.
 
+       * math_nestinset.C (notifyCursorLeaves): generate the preview only
+       when leaving an inset with depth() == 1.
+
 2002-07-22  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * math_support.C (mathed_draw_deco): fix rounding bug for rotated
index 520474d1974a9e07f8221e3db0aa2dda76eb6acf..7cc4da7c804ca799e03688066547ced320a24a28 100644 (file)
@@ -277,12 +277,16 @@ MathArray MathNestInset::glue() const
 
 void MathNestInset::notifyCursorLeaves()
 {
-       //lyxerr << "leaving " << *this << "\n";
-       if (!mathcursor || !grfx::Previews::activated())
+       // Generate a preview only if previews are active and we are leaving
+       // the InsetFormula itself
+       if (!grfx::Previews::activated() ||
+           !mathcursor || mathcursor->depth() != 1)
                return;
 
        InsetFormulaBase * inset = mathcursor->formula();
        BufferView * bufferview = inset->view();
+
+       // Paranoia check
        if (!bufferview || !bufferview->buffer())
                return;