1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

TextEditor: Fix caret size in first and last position when line spacing is non-unity

This commit is contained in:
attila 2025-04-22 17:01:01 +02:00 committed by Attila Szarvas
parent d2d5e9bdd2
commit 56b7b7621e

View file

@ -2164,7 +2164,7 @@ float TextEditor::getJustificationOffsetX() const
TextEditor::CaretEdge TextEditor::getDefaultCursorEdge() const
{
return { { getJustificationOffsetX(), 0.0f }, currentFont.getHeight() };
return { { getJustificationOffsetX(), 0.0f }, currentFont.getHeight() * lineSpacing };
}
TextEditor::CaretEdge TextEditor::getCursorEdge (const CaretState& tempCaret) const
@ -2183,7 +2183,7 @@ TextEditor::CaretEdge TextEditor::getCursorEdge (const CaretState& tempCaret) co
const auto& lastParagraph = textStorage->back().value;
return { { getJustificationOffsetX(), lastParagraph->getTop() + lastParagraph->getHeight() },
currentFont.getHeight() };
currentFont.getHeight() * lineSpacing };
}
return getTextSelectionEdge (visualIndex, tempCaret.getEdge());