GTextEditor: Minor cleanup

Remove an unnecessary layer of nesting
This commit is contained in:
Robin Burchell 2019-05-16 00:15:58 +02:00 committed by Andreas Kling
commit 966c5d10b1
Notes: sideshowbarker 2024-07-19 14:07:40 +09:00

View file

@ -159,7 +159,10 @@ void GTextEditor::doubleclick_event(GMouseEvent& event)
void GTextEditor::mousedown_event(GMouseEvent& event)
{
if (event.button() == GMouseButton::Left) {
if (event.button() != GMouseButton::Left) {
return;
}
if (event.modifiers() & Mod_Shift) {
if (!has_selection())
m_selection.set(m_cursor, { });
@ -182,8 +185,6 @@ void GTextEditor::mousedown_event(GMouseEvent& event)
// FIXME: Only update the relevant rects.
update();
did_update_selection();
return;
}
}
void GTextEditor::mouseup_event(GMouseEvent& event)