allowed counter bubble size to be adjustable, font to autofill, and fixed issue with low DPI undo

This commit is contained in:
Jeremy Borgman
2020-09-06 20:43:24 -05:00
committed by borgmanJeremy
parent 889b688ee2
commit 7b0888a0b0

View File

@@ -67,21 +67,29 @@ CircleCountTool::process(QPainter& painter,
}
painter.setBrush(m_color);
int bubble_size = 16;
int bubble_size = m_thickness;
painter.drawEllipse(m_points.first, bubble_size, bubble_size);
auto orig_font = painter.font();
auto new_font = orig_font;
new_font.setPixelSize(m_thickness);
painter.setFont(new_font);
painter.drawText(QRectF(m_points.first.x() - bubble_size / 2,
m_points.first.y() - bubble_size / 2,
bubble_size,
bubble_size),
Qt::AlignCenter,
QString::number(m_count));
painter.setFont(orig_font);
}
void
CircleCountTool::paintMousePreview(QPainter& painter,
const CaptureContext& context)
{
painter.setPen(QPen(context.color, PADDING_VALUE + context.thickness));
painter.setPen(QPen(context.color,
PADDING_VALUE + context.thickness,
Qt::SolidLine,
Qt::RoundCap));
painter.drawLine(context.mousePos, context.mousePos);
}