* move some code that handle selection to paintInset()
* change the arguments of paintSeparator()
void RowPainter::paintInset(Inset const * inset, pos_type const pos)
{
void RowPainter::paintInset(Inset const * inset, pos_type const pos)
{
+ // Handle selection
+ bool const pi_selected = pi_.selected;
+ Cursor const & cur = pi_.base.bv->cursor();
+ if (cur.selection() && cur.text() == &text_
+ && cur.normalAnchor().text() == &text_)
+ pi_.selected = row_.sel_beg <= pos && row_.sel_end > pos;
+
Font const font = text_metrics_.displayFont(pit_, pos);
LASSERT(inset, return);
Font const font = text_metrics_.displayFont(pit_, pos);
LASSERT(inset, return);
pi_.full_repaint = pi_full_repaint;
pi_.change_ = prev_change;
pi_.do_spellcheck = pi_do_spellcheck;
pi_.full_repaint = pi_full_repaint;
pi_.change_ = prev_change;
pi_.do_spellcheck = pi_do_spellcheck;
+ pi_.selected = pi_selected;
#ifdef DEBUG_METRICS
int const x2 = x1 + dim.wid;
#ifdef DEBUG_METRICS
int const x2 = x1 + dim.wid;
-void RowPainter::paintSeparator(double orig_x, double width,
- FontInfo const & font)
+void RowPainter::paintSeparator(double width, Font const & font)
- pi_.pain.textDecoration(font, int(orig_x), yo_, int(width));
+ pi_.pain.textDecoration(font.fontInfo(), int(x_), yo_, int(width));
double separator_width = width_pos;
if (pos >= body_pos)
separator_width += row_.separator;
double separator_width = width_pos;
if (pos >= body_pos)
separator_width += row_.separator;
- paintSeparator(orig_x, separator_width, orig_font.fontInfo());
+ paintSeparator(separator_width, orig_font);
paintForeignMark(orig_x, orig_font.language());
++vpos;
} else if (inset) {
// If outer row has changed, nested insets are repaint completely.
pi_.base.bv->coordCache().insets().add(inset, int(x_), yo_);
paintForeignMark(orig_x, orig_font.language());
++vpos;
} 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.normalAnchor().text() == &text_)
- pi_.selected = row_.sel_beg <= pos && row_.sel_end > pos;
- pi_.selected = pi_selected;
void paintFirst() const;
void paintLast();
void paintText();
void paintFirst() const;
void paintLast();
void paintText();
void paintOnlyInsets();
void paintSelection() const;
private:
void paintOnlyInsets();
void paintSelection() const;
private:
- void paintSeparator(double orig_x, double width, FontInfo const & font);
+ void paintSeparator(double width, Font const & font);
void paintForeignMark(double orig_x, Language const * lang, int desc = 0) const;
void paintStringAndSel(docstring const & str, Font const & font,
Change const & change,
void paintForeignMark(double orig_x, Language const * lang, int desc = 0) const;
void paintStringAndSel(docstring const & str, Font const & font,
Change const & change,