]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.cpp
* GuiDocument.cpp (less_textclass_avail_desc):
[lyx.git] / src / rowpainter.cpp
index 0a097ed9f257edd0308bae09e473db4025b64e4d..3b7bbe09db2c5b427cbd87ae7b2a4f62873fb71a 100644 (file)
@@ -109,6 +109,7 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
        pi_.erased_ = erased_ || par_.isDeleted(pos);
        pi_.base.bv->coordCache().insets().add(inset, int(x_), yo_);
        // insets are painted completely. Recursive
+       inset->drawBackground(pi_, int(x_), yo_);
        inset->drawSelection(pi_, int(x_), yo_);
        inset->draw(pi_, int(x_), yo_);
 
@@ -683,7 +684,14 @@ void RowPainter::paintOnlyInsets()
                if (x_ > pi_.base.bv->workWidth())
                        continue;
                x_ = pi_.base.bv->coordCache().getInsets().x(inset);
+
+               bool const pi_selected = pi_.selected;
+               Cursor const & cur = pi_.base.bv->cursor();
+               if (cur.selection() && cur.text() == &text_ 
+                         && cur.anchor().text() == &text_)
+                       pi_.selected = row_.sel_beg <= pos && row_.sel_end > pos; 
                paintInset(inset, pos);
+               pi_.selected = pi_selected;
        }
 }
 
@@ -818,7 +826,14 @@ void RowPainter::paintText()
                } else if (inset) {
                        // If outer row has changed, nested insets are repaint completely.
                        pi_.base.bv->coordCache().insets().add(inset, int(x_), yo_);
+                       
+                       bool const pi_selected = pi_.selected;
+                       Cursor const & cur = pi_.base.bv->cursor();
+                       if (cur.selection() && cur.text() == &text_ 
+                                 && cur.anchor().text() == &text_)
+                               pi_.selected = row_.sel_beg <= pos && row_.sel_end > pos; 
                        paintInset(inset, pos);
+                       pi_.selected = pi_selected;
                        ++vpos;
 
                } else {