From fb9470847205a4ecd95b9107244e5f0b3a296969 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 3 Apr 2002 13:53:46 +0000 Subject: [PATCH] fix mouse clicks for macro insets git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3891 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/formulamacro.C | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/mathed/formulamacro.C b/src/mathed/formulamacro.C index 48d87cf403..1ba228702a 100644 --- a/src/mathed/formulamacro.C +++ b/src/mathed/formulamacro.C @@ -165,7 +165,7 @@ MathInsetTypes InsetFormulaMacro::getType() const void InsetFormulaMacro::draw(BufferView * bv, LyXFont const & f, - int y, float & x, bool /*cleared*/) const + int y, float & xx, bool /*cleared*/) const { Painter & pain = bv->painter(); LyXFont font(f); @@ -173,23 +173,26 @@ void InsetFormulaMacro::draw(BufferView * bv, LyXFont const & f, // label font.setColor(LColor::math); + int const x = int(xx); int const a = y - ascent(bv, font) + 1; int const w = width(bv, font) - 2; int const h = ascent(bv, font) + descent(bv, font) - 2; // LColor::mathbg used to be "AntiqueWhite" but is "linen" now, too - pain.fillRectangle(int(x), a , w, h, LColor::mathmacrobg); - pain.rectangle(int(x), a, w, h, LColor::mathframe); + pain.fillRectangle(x, a, w, h, LColor::mathmacrobg); + pain.rectangle(x, a, w, h, LColor::mathframe); if (mathcursor && const_cast(mathcursor->formula()) == this) mathcursor->drawSelection(pain); - pain.text(int(x + 2), y, prefix(), font); - x += width(bv, font); + pain.text(x + 2, y, prefix(), font); // formula - xo_ = int(x) - par()->width() - 5; + par()->draw(pain, xx + lyxfont::width(prefix(), f) + 5, yo_); + xx += w + 2; + xo_ = x; yo_ = y; - par()->draw(pain, xo_, yo_); + + setCursorVisible(false); } -- 2.39.2