[EMAIL PROTECTED] wrote:
Author: younes
Date: Fri Aug 31 00:46:22 2007
New Revision: 19934

URL: http://www.lyx.org/trac/changeset/19934
Log:
Transfer Text::drawSelection() from InsetText::drawSelection() to 
InsetText::draw(). This enables to take care of the background at one place. 
This will also enable to draw only the selection in the future (and not the 
full inset).

Modified:
    lyx-devel/trunk/src/insets/InsetText.cpp

Modified: lyx-devel/trunk/src/insets/InsetText.cpp
URL: 
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetText.cpp?rev=19934
==============================================================================
--- lyx-devel/trunk/src/insets/InsetText.cpp (original)
+++ lyx-devel/trunk/src/insets/InsetText.cpp Fri Aug 31 00:46:22 2007
@@ -202,23 +202,13 @@
                if (drawFrame_)
                        pi.pain.rectangle(x, y - a, w, h, frameColor());
        }
+       text_.drawSelection(pi, x + border_, y);
        tm.draw(pi, x + border_, y);
 }
void InsetText::drawSelection(PainterInfo & pi, int x, int y) const
 {
-       if (!pi.base.bv->cursor().selection())
-               return;
-
-       TextMetrics & tm = pi.base.bv->textMetrics(&text_);
-       int const w = tm.width() + 2 * border_;
-       int const a = tm.ascent() + border_;
-       int const h = a + tm.descent() + border_;
-       pi.pain.fillRectangle(x, y - a,
-                             (hasFixedWidth() ? tm.maxWidth() : w),
-                             h, backgroundColor());
-       text_.drawSelection(pi, x + border_, y);
 }

So why keep the empty implementation? InsetText derives from Inset which has an empty implementation of this method already.

Angus

Reply via email to