From 6b96d207937dd84e5ecda2b2ae60075df7577121 Mon Sep 17 00:00:00 2001 From: peri4 Date: Tue, 24 May 2022 09:49:18 +0300 Subject: [PATCH] graphic trace text background --- libs/graphic/graphic.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/graphic/graphic.cpp b/libs/graphic/graphic.cpp index 65df99e..7835705 100644 --- a/libs/graphic/graphic.cpp +++ b/libs/graphic/graphic.cpp @@ -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); }