graphic trace text background

This commit is contained in:
2022-05-24 09:49:18 +03:00
parent 0608834db3
commit 6b96d20793

View File

@@ -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 (apos.y() - r.height() < font_sz.height() / 8.) p.setY(apos.y() + r.height() - font_sz.height() / 8.);
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);
}