~aleteoryx/muditaos

c64382a8bf82cc1d5045b1b1fd2be79265a86922 — Lefucjusz 3 years ago eef08b0
[MOS-757] Fix wrong cursor final position after deleting

Fix of the issue that after partially deleting
the text, the cursor sometimes was positioned
somewhere in the middle of the remaining text,
not at the beginning where it should.
1 files changed, 2 insertions(+), 2 deletions(-)

M module-gui/gui/widgets/text/Text.cpp
M module-gui/gui/widgets/text/Text.cpp => module-gui/gui/widgets/text/Text.cpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "Text.hpp"


@@ 196,7 196,7 @@ namespace gui
        buildDocument(newText);

        /* Rewind cursor to the beginning of the line */
        cursor->moveCursor(NavigationDirection::LEFT, cursorPosition);
        cursor->moveCursor(NavigationDirection::LEFT, substrLength);

        onTextChanged();
    }