From e1928a2109783594529fd5938dfdc94af38646d3 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 28 Feb 2005 11:32:58 +0000 Subject: [PATCH] =?utf8?q?(Andr=EF=BF=BD=EF=BF=BD):=20partial=20fix=20for?= =?utf8?q?=20mouse=20handling=20in=20math=20insets.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9686 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 6 ++++++ src/mathed/math_nestinset.C | 32 +++++++++----------------------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 2cd9ed062f..5832bc7368 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,9 @@ +2005-02-28 André Pönitz + + * math_nestinset.C (lfunMouseRelease, lfunMouseMotion, lfunMousePress): + remove ancient hack and get mouse actions inside nested mathed insets + working again. + 2005-02-23 Georg Baum * math_parinset.[Ch] (doClone): Implement, avoids triggering the diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index 9c992cfaee..2aef636f4a 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -63,18 +63,6 @@ using std::string; using std::istringstream; - -namespace { - -// local global -int first_x; -int first_y; - -} // namespace anon - - - - MathNestInset::MathNestInset(idx_type nargs) : cells_(nargs), lock_(false) {} @@ -956,11 +944,9 @@ InsetBase * MathNestInset::editXY(LCursor & cur, int x, int y) const void MathNestInset::lfunMousePress(LCursor & cur, FuncRequest & cmd) { - lyxerr << "lfunMousePress: buttons: " << cmd.button() << endl; + //lyxerr << "## lfunMousePress: buttons: " << cmd.button() << endl; if (cmd.button() == mouse_button::button1) { - first_x = cmd.x; - first_y = cmd.y; - lyxerr << "lfunMousePress: setting cursor to: " << cur << endl; + //lyxerr << "## lfunMousePress: setting cursor to: " << cur << endl; cur.resetAnchor(); cur.bv().cursor() = cur; } @@ -976,22 +962,22 @@ void MathNestInset::lfunMouseMotion(LCursor & cur, FuncRequest & cmd) // only select with button 1 if (cmd.button() == mouse_button::button1) { LCursor & bvcur = cur.bv().cursor(); - if (abs(cmd.x - first_x) + abs(cmd.y - first_y) > 4 - && bvcur.anchor_.hasPart(cur)) { - first_x = cmd.x; - first_y = cmd.y; - + if (bvcur.anchor_.hasPart(cur)) { + //lyxerr << "## lfunMouseMotion: cursor: " << cur << endl; bvcur.setCursor(cur); bvcur.selection() = true; - } else + //lyxerr << "MOTION " << bvcur << endl; + } + else { cur.undispatched(); + } } } void MathNestInset::lfunMouseRelease(LCursor & cur, FuncRequest & cmd) { - lyxerr << "lfunMouseRelease: buttons: " << cmd.button() << endl; + //lyxerr << "## lfunMouseRelease: buttons: " << cmd.button() << endl; if (cmd.button() == mouse_button::button1) { //cur.bv().stuffClipboard(cur.grabSelection()); -- 2.39.2