Skip to content

Commit

Permalink
allow numpad numers to resize and fix text artifacting on large resize (
Browse files Browse the repository at this point in the history
  • Loading branch information
borgmanJeremy authored Feb 7, 2022
1 parent 5e35f1e commit bcb4041
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/widgets/capture/capturewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,8 @@ void CaptureWidget::keyPressEvent(QKeyEvent* e)
// If the key is a digit, change the tool size
bool 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;
setToolSize(m_toolSizeByKeyboard);
if (m_context.toolSize != m_toolSizeByKeyboard) {
Expand Down Expand Up @@ -1242,6 +1243,8 @@ void CaptureWidget::onToolSizeChanged(int t)
drawToolsData();
updateTool(toolItem);
}
// Force a repaint to prevent artifacting
this->repaint();
}

void CaptureWidget::onToolSizeSettled(int size)
Expand Down

0 comments on commit bcb4041

Please sign in to comment.