From: Jean-Marc Lasgouttes Date: Fri, 4 Jan 2019 15:24:18 +0000 (+0100) Subject: Fix drawing of labels in insets X-Git-Tag: lyx-2.4.0dev-acb2ca7b~2739 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5c1d65afee3a37d5befcf9eb55d8d50e1d8e4f13;p=features.git Fix drawing of labels in insets In many cases, the origin xo_ of insets was forgotten. Fixes bug #11425. --- diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp index 43b3be20ce..60bb5a7410 100644 --- a/src/RowPainter.cpp +++ b/src/RowPainter.cpp @@ -432,7 +432,7 @@ void RowPainter::paintLabel() const double x = x_; if (row_.isRTL()) - x = tm_.width() - row_.right_margin + fm.width(layout.labelsep); + x = xo_ + tm_.width() - row_.right_margin + fm.width(layout.labelsep); else x = x_ - fm.width(layout.labelsep) - fm.width(str); @@ -467,10 +467,10 @@ void RowPainter::paintTopLevelLabel() const 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); } @@ -557,9 +557,9 @@ void RowPainter::paintLast() const } if (endlabel == END_LABEL_BOX) - pi_.pain.rectangle(x, y, size, size, font.realColor()); + pi_.pain.rectangle(xo_ + x, y, size, size, font.realColor()); else - pi_.pain.fillRectangle(x, y, size, size, font.realColor()); + pi_.pain.fillRectangle(xo_ + x, y, size, size, font.realColor()); break; }