double x = x_;
if (layout.labeltype == LABEL_CENTERED) {
+ // The 'size + 1' is weird, but it makes sure that we get the
+ // left margin of non-first row.
+ int leftm = tm_.leftMargin(row_.pit(), par_.size() + 1);
+ int rightm = tm_.rightMargin(row_.pit());
+ if (row_.isRTL())
+ swap(leftm, rightm);
/* Currently, x points at row_.left_margin (which contains the
* indent). First remove that, and then center the title with
* respect to the left and right margins.
*/
- int const leftm = row_.isRTL() ? tm_.rightMargin(row_.pit())
- : tm_.leftMargin(row_.pit());
- int const rightm = row_.isRTL() ? tm_.leftMargin(row_.pit())
- : tm_.rightMargin(row_.pit());
x += leftm - row_.left_margin + (tm_.width() - leftm -rightm) / 2
- fm.width(str) / 2;
} else if (row_.isRTL()) {
pi_.pain.fillRectangle(int(x), y1,
int(xo_ + tm_.width()) - int(x), y2 - y1,
Color_selection);
+}
+
+void RowPainter::paintBookmark(int num) const
+{
+ int const x = row_.isRTL()
+ ? pi_.base.bv->workWidth() - pi_.base.bv->rightMargin() : 0;
+ FontInfo fi = pi_.base.bv->buffer().params().getFont().fontInfo();
+ fi.setColor(Color_bookmark);
+ // ❶ U+2776 DINGBAT NEGATIVE CIRCLED DIGIT ONE
+ char_type const ch = 0x2775 + num;
+ pi_.pain.text(x, yo_, ch, fi);
}