Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/windowing/StarTextBoxWidget.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-28 20:25:53 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-28 20:26:04 +1000
commitbe8c722a7ea8c5fe8406de0f3ce79c134ff2eb46 (patch)
tree4f51ff1e1370dae6e895767f3062b8163e0e626f /source/windowing/StarTextBoxWidget.cpp
parent98c4e55380baefc3aae58ead213052ea713e00c7 (diff)
Fix normal backspace broken by previous change
Diffstat (limited to 'source/windowing/StarTextBoxWidget.cpp')
-rw-r--r--source/windowing/StarTextBoxWidget.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/windowing/StarTextBoxWidget.cpp b/source/windowing/StarTextBoxWidget.cpp
index db9374c..bc64d37 100644
--- a/source/windowing/StarTextBoxWidget.cpp
+++ b/source/windowing/StarTextBoxWidget.cpp
@@ -334,15 +334,16 @@ bool TextBoxWidget::innerSendEvent(InputEvent const& event) {
}
auto calculateSteps = [&](bool dir) {
+ int steps = 1;
if ((keyDown->mods & (KeyMod::LCtrl | KeyMod::RCtrl)) != KeyMod::NoMod || (keyDown->mods & (KeyMod::LAlt | KeyMod::RAlt)) != KeyMod::NoMod) {
- int steps;
if (dir) // right
- steps = m_text.findNextBoundary(m_cursorOffset) - m_cursorOffset;
+ steps = m_text.findNextBoundary(m_cursorOffset) - m_cursorOffset;
else // left
- steps = m_cursorOffset - m_text.findNextBoundary(m_cursorOffset, true);
+ steps = m_cursorOffset - m_text.findNextBoundary(m_cursorOffset, true);
return steps < 1 ? 1 : steps;
}
+ return steps;
};
if (keyDown->key == Key::Backspace) {