Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<PropertyGroup>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AvaloniaVersion>11.0.0</AvaloniaVersion>
<AvaloniaSampleVersion>11.3.0</AvaloniaSampleVersion>
<AvaloniaVersion>11.3.9</AvaloniaVersion>
<AvaloniaSampleVersion>11.3.9</AvaloniaSampleVersion>
<TextMateSharpVersion>1.0.66</TextMateSharpVersion>
<VersionSuffix>beta</VersionSuffix>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<EmbedUntrackedSources>true</EmbedUntrackedSources>

<Version>11.3.0</Version>
<Version>11.3.9</Version>
<Authors>Avalonia Team</Authors>
<Copyright>Copyright 2017-$([System.DateTime]::Now.ToString(`yyyy`)) &#169; The AvaloniaUI Project</Copyright>
<RepositoryUrl>https://github.com/AvaloniaUI/AvaloniaEdit/</RepositoryUrl>
Expand Down
10 changes: 5 additions & 5 deletions src/AvaloniaEdit/Editing/Caret.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ private Rect CalcCaretRectangle(VisualLine visualLine)

var textLine = visualLine.GetTextLine(_position.VisualColumn, _position.IsAtEndOfLine);
var xPos = visualLine.GetTextLineVisualXPosition(textLine, _position.VisualColumn);
var lineTop = visualLine.GetTextLineVisualYPosition(textLine, VisualYPosition.TextTop);
var lineBottom = visualLine.GetTextLineVisualYPosition(textLine, VisualYPosition.TextBottom);
var lineTop = visualLine.GetTextLineVisualYPosition(textLine, VisualYPosition.LineTop);
var lineBottom = visualLine.GetTextLineVisualYPosition(textLine, VisualYPosition.LineBottom);

return new Rect(xPos,
lineTop,
Expand All @@ -419,15 +419,15 @@ Rect CalcCaretOverstrikeRectangle(VisualLine visualLine)
// This is necessary to ensure the rectangle is calculated correctly in bidirectional text.
var textBounds = textLine.GetTextBounds(currentPos, nextPos - currentPos)[0];
r = textBounds.Rectangle;
var y = r.Y + visualLine.GetTextLineVisualYPosition(textLine, VisualYPosition.TextTop);
var y = r.Y + visualLine.GetTextLineVisualYPosition(textLine, VisualYPosition.LineTop);
r = r.WithY(y);
} else {
// If the caret is at the end of the line (or in virtual space),
// use the visual X position of currentPos and nextPos (one or more of which will be in virtual space)
double xPos = visualLine.GetTextLineVisualXPosition(textLine, currentPos);
double xPos2 = visualLine.GetTextLineVisualXPosition(textLine, nextPos);
double lineTop = visualLine.GetTextLineVisualYPosition(textLine, VisualYPosition.TextTop);
double lineBottom = visualLine.GetTextLineVisualYPosition(textLine, VisualYPosition.TextBottom);
double lineTop = visualLine.GetTextLineVisualYPosition(textLine, VisualYPosition.LineTop);
double lineBottom = visualLine.GetTextLineVisualYPosition(textLine, VisualYPosition.LineBottom);
r = new Rect(xPos, lineTop, xPos2 - xPos, lineBottom - lineTop);
}
// If the caret is too small (e.g. in front of zero-width character), ensure it's still visible
Expand Down