graphic trace text background
This commit is contained in:
@@ -1513,6 +1513,10 @@ void Graphic::drawGuides() {
|
|||||||
if (r.width() + apos.x() > wid - font_sz.height() / 2.) p.setX(apos.x() - r.width() - font_sz.height() / 4.);
|
if (r.width() + apos.x() > wid - font_sz.height() / 2.) p.setX(apos.x() - r.width() - font_sz.height() / 4.);
|
||||||
if (apos.y() - r.height() < font_sz.height() / 8.) p.setY(apos.y() + r.height() - font_sz.height() / 8.);
|
if (apos.y() - r.height() < font_sz.height() / 8.) p.setY(apos.y() + r.height() - font_sz.height() / 8.);
|
||||||
painter->setPen(text_color);
|
painter->setPen(text_color);
|
||||||
|
QRect trect = painter->fontMetrics().boundingRect(str);
|
||||||
|
QColor tcol = back_color;
|
||||||
|
tcol.setAlphaF(0.65);
|
||||||
|
painter->fillRect(trect.translated(p), tcol);
|
||||||
painter->drawText(p, str);
|
painter->drawText(p, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user