BreakpointWidget: Fix drawing of icon when breakpoints are disabled

Fix incorrect scaling of the gap drawn inside enabled breakpoints in
BreakpointWidget when breakpoints are globally disabled and the font
size is changed from the default.

As the font size increased the gap would become larger and its center
would "migrate" downward and rightward until the gap stopped being
visible at all.

Additionally, at small font sizes integer truncation issues could result
in the gap being offset towards the top left.
This commit is contained in:
Dentomologist 2026-04-03 16:18:19 -07:00
parent d3b89b4c39
commit 69a5e516ed

View File

@ -306,9 +306,14 @@ void BreakpointWidget::Update()
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(Qt::NoPen);
painter.setBrush(Qt::transparent);
// Center and radius
painter.drawEllipse(QPoint(downscale / 2, downscale / 2), downscale / 4, downscale / 4);
const float icon_radius = static_cast<float>(image.height()) / 2.0f;
const float gap_radius = icon_radius / 2.0f;
const QPointF center(icon_radius, icon_radius);
painter.drawEllipse(center, gap_radius, gap_radius);
painter.end();
enabled_icon = QPixmap::fromImage(image);
}