Layout const & layout = par_.layout();
FontInfo const font = labelFont(false);
FontMetrics const & fm = theFontMetrics(font);
- double x = x_;
-
- if (row_.isRTL())
- x = tm_.width() - row_.right_margin + fm.width(layout.labelsep);
- else
- x = x_ - fm.width(layout.labelsep) - fm.width(str);
+ int const x = row_.isRTL() ? row_.width() + fm.width(layout.labelsep)
+ : row_.left_margin - fm.width(layout.labelsep) - fm.width(str);
- pi_.pain.text(int(x), yo_, str, font);
+ pi_.pain.text(xo_ + x, yo_, str, font);
}
double x = x_;
if (layout.labeltype == LABEL_CENTERED) {
- x = row_.left_margin + (tm_.width() - row_.left_margin - row_.right_margin) / 2;
+ x += (tm_.width() - row_.left_margin - row_.right_margin) / 2;
x -= fm.width(str) / 2;
} else if (row_.isRTL()) {
- x = tm_.width() - row_.right_margin - fm.width(str);
+ x = xo_ + tm_.width() - row_.right_margin - fm.width(str);
}
pi_.pain.text(int(x), yo_ - maxdesc - labeladdon, str, font);
}
}
if (endlabel == END_LABEL_BOX)
- pi_.pain.rectangle(x, y, size, size, font.realColor());
+ pi_.pain.rectangle(int(xo_) + x, y, size, size, font.realColor());
else
- pi_.pain.fillRectangle(x, y, size, size, font.realColor());
+ pi_.pain.fillRectangle(int(xo_) + x, y, size, size, font.realColor());
break;
}
void RowPainter::paintOnlyInsets()
{
- Row::const_iterator cit = row_.begin();
- Row::const_iterator const & end = row_.end();
- for ( ; cit != end ; ++cit) {
- Row::Element const & e = *cit;
+ for (Row::Element const & e : row_) {
if (e.type == Row::INSET) {
paintInset(e);
// The markings of foreign languages
void RowPainter::paintText()
{
- Row::const_iterator cit = row_.begin();
- Row::const_iterator const & end = row_.end();
- for ( ; cit != end ; ++cit) {
- Row::Element const & e = *cit;
-
+ for (Row::Element const & e : row_) {
switch (e.type) {
case Row::STRING:
case Row::VIRTUAL: