allow numpad numers to resize and fix text artifacting on large resize (#2386)

This commit is contained in:
borgmanJeremy
2022-02-07 08:19:43 -06:00
committed by GitHub
parent 5e35f1e099
commit bcb4041e0e

View File

@@ -821,7 +821,8 @@ void CaptureWidget::keyPressEvent(QKeyEvent* e)
// If the key is a digit, change the tool size // If the key is a digit, change the tool size
bool ok; bool ok;
int digit = e->text().toInt(&ok); int digit = e->text().toInt(&ok);
if (ok && e->modifiers() == Qt::NoModifier) { // digit received if (ok && ((e->modifiers() == Qt::NoModifier) ||
e->modifiers() == Qt::KeypadModifier)) { // digit received
m_toolSizeByKeyboard = 10 * m_toolSizeByKeyboard + digit; m_toolSizeByKeyboard = 10 * m_toolSizeByKeyboard + digit;
setToolSize(m_toolSizeByKeyboard); setToolSize(m_toolSizeByKeyboard);
if (m_context.toolSize != m_toolSizeByKeyboard) { if (m_context.toolSize != m_toolSizeByKeyboard) {
@@ -1242,6 +1243,8 @@ void CaptureWidget::onToolSizeChanged(int t)
drawToolsData(); drawToolsData();
updateTool(toolItem); updateTool(toolItem);
} }
// Force a repaint to prevent artifacting
this->repaint();
} }
void CaptureWidget::onToolSizeSettled(int size) void CaptureWidget::onToolSizeSettled(int size)