Browse Source

TextEditor: Avoid moveCaretTo(Start|End)OfLine moving to the previous line

v7.0.9
reuk 1 year ago
parent
commit
3387ca362c
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      modules/juce_gui_basics/widgets/juce_TextEditor.cpp

+ 2
- 2
modules/juce_gui_basics/widgets/juce_TextEditor.cpp View File

@@ -2073,7 +2073,7 @@ bool TextEditor::moveCaretToTop (bool selecting)
bool TextEditor::moveCaretToStartOfLine (bool selecting)
{
const auto caretPos = (getCaretRectangle() - getTextOffset()).toFloat();
return moveCaretWithTransaction (indexAtPosition (0.0f, caretPos.getY()), selecting);
return moveCaretWithTransaction (indexAtPosition (0.0f, caretPos.getCentreY()), selecting);
}
bool TextEditor::moveCaretToEnd (bool selecting)
@@ -2084,7 +2084,7 @@ bool TextEditor::moveCaretToEnd (bool selecting)
bool TextEditor::moveCaretToEndOfLine (bool selecting)
{
const auto caretPos = (getCaretRectangle() - getTextOffset()).toFloat();
return moveCaretWithTransaction (indexAtPosition ((float) textHolder->getWidth(), caretPos.getY()), selecting);
return moveCaretWithTransaction (indexAtPosition ((float) textHolder->getWidth(), caretPos.getCentreY()), selecting);
}
bool TextEditor::deleteBackwards (bool moveInWholeWordSteps)


Loading…
Cancel
Save