-int RowPainter::paintLengthMarker(string const & prefix, VSpace const & vsp, int start)
-{
- if (vsp.kind() == VSpace::NONE)
- return 0;
-
- int const arrow_size = 4;
- int const size = getLengthMarkerHeight(bv_, vsp);
- int const end = start + size;
-
- // the label to display (if any)
- string str;
- // y-values for top arrow
- int ty1, ty2;
- // y-values for bottom arrow
- int by1, by2;
-
- str = prefix + " (" + vsp.asLyXCommand() + ")";
-
- if (vsp.kind() == VSpace::VFILL) {
- ty1 = ty2 = start;
- by1 = by2 = end;
- } else {
- // adding or removing space
- bool const added = vsp.kind() != VSpace::LENGTH ||
- vsp.length().len().value() > 0.0;
- ty1 = added ? (start + arrow_size) : start;
- ty2 = added ? start : (start + arrow_size);
- by1 = added ? (end - arrow_size) : end;
- by2 = added ? end : (end - arrow_size);
- }
-
- int const leftx = int(xo_) + leftMargin();
- int const midx = leftx + arrow_size;
- int const rightx = midx + arrow_size;
-
- // first the string
- int w = 0;
- int a = 0;
- int d = 0;
-
- LyXFont font;
- font.setColor(LColor::added_space);
- font.decSize();
- font.decSize();
- font_metrics::rectText(str, font, w, a, d);
-
- pain_.rectText(leftx + 2 * arrow_size + 5,
- start + ((end - start) / 2) + d,
- str, font,
- LColor::none, LColor::none);
-
- // top arrow
- pain_.line(leftx, ty1, midx, ty2, LColor::added_space);
- pain_.line(midx, ty2, rightx, ty1, LColor::added_space);
-
- // bottom arrow
- pain_.line(leftx, by1, midx, by2, LColor::added_space);
- pain_.line(midx, by2, rightx, by1, LColor::added_space);
-
- // joining line
- pain_.line(midx, ty2, midx, by2, LColor::added_space);
-
- return size;
-}
-
-
-int RowPainter::paintPageBreak(string const & label, int y)
-{
- LyXFont pb_font;
- pb_font.setColor(LColor::pagebreak);
- pb_font.decSize();
-
- int w = 0;
- int a = 0;
- int d = 0;
- font_metrics::rectText(label, pb_font, w, a, d);
-
- int const text_start = int(xo_ + (width_ - w) / 2);
- int const text_end = text_start + w;
-
- pain_.rectText(text_start, y + d, label, pb_font, LColor::none, LColor::none);
-
- pain_.line(int(xo_), y, text_start, y,
- LColor::pagebreak, Painter::line_onoffdash);
- pain_.line(text_end, y, int(xo_ + width_), y,
- LColor::pagebreak, Painter::line_onoffdash);
-
- return 3 * defaultRowHeight();
-}
-
-