mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-27 02:20:05 +00:00
TextEditor: Avoid moveCaretTo(Start|End)OfLine moving to the previous line
This commit is contained in:
parent
97fa2f0e8a
commit
3387ca362c
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue