]> git.lyx.org Git - lyx.git/blobdiff - src/RowPainter.cpp
Store both sets of font selections
[lyx.git] / src / RowPainter.cpp
index 3466a041b7bd78d7566e8b13a8e1b5d9101e8492..ce5780bb4c65b8bf4c7031c04b380ce80cae4503 100644 (file)
@@ -139,7 +139,7 @@ void RowPainter::paintInset(Inset const * inset, Font const & font,
        inset->drawSelection(pi_, x1, yo_);
        inset->draw(pi_, x1, yo_);
 
-       Dimension const & dim = pm_.insetDimension(inset);
+       Dimension const & dim = pi_.base.bv->coordCache().insets().dim(inset);
 
        paintForeignMark(x_, font.language(), dim.descent());
 
@@ -243,13 +243,11 @@ void RowPainter::paintStringAndSel(Row::Element const & e)
        bool const all_sel = (e.pos >= row_.sel_beg && e.endpos < row_.sel_end)
                || pi_.selected;
 
-       if (all_sel) {
+       if (all_sel || e.change.changed()) {
                Font copy = e.font;
-               copy.fontInfo().setPaintColor(Color_selectiontext);
-               pi_.pain.text(int(x_), yo_, e.str, copy, e.extra);
-       } else if (e.change.changed()) {
-               Font copy = e.font;
-               copy.fontInfo().setPaintColor(e.change.color());
+               Color const col = e.change.changed() ? e.change.color()
+                                                    : Color_selectiontext;
+               copy.fontInfo().setPaintColor(col);
                pi_.pain.text(int(x_), yo_, e.str, copy, e.extra);
        } else if (!some_sel) {
                pi_.pain.text(int(x_), yo_, e.str, e.font, e.extra);