Fix rounding error when getting VisualLine #425
No reviewers
Labels
No labels
Area-Accessibility
Area-Build
Area-CodeCompletion
Area-Document
Area-Documentation
Area-Editing
Area-Folding
Area-Highlighting
Area-i18n
Area-Indentation
Area-NetFx
Area-Rendering
Area-Search
Area-Snippets
dependencies
duplicate
Feedback Needed
help wanted
invalid
Issue-Bug
Issue-Discussion
Issue-Enhancement
Issue-Performance
Issue-Question
on-hold
Resolution-Answered
Resolution-By Design
Resolution-Duplicate
Resolution-Fixed
Resolution-Won't Fix
Up-for-Grabs
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-icsharpcode/AvalonEdit!425
Loading…
Reference in a new issue
No description provided.
Delete branch "trijnsburger/Fix-rounding-error-when-getting-VisualLine"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A rounding error occasionally occurs here (found when using RectangleSelect), causing this method to unexpectedly return null, which in turn causes RectangleSelection.ReplaceSelectionWithText() to incorrectly set textArea.Caret.Position to (Line = 1, Column = 1).
Note that the epsilon value of 1e-12 is an estimation based on the accuracy of the visualTop value, which has 13 decimals when its integer value is in the thousands (4 digits).
Can you please provide reproduction steps (using ICSharpCode.AvalonEdit.Sample.exe) for this problem? The
GetVisualLineFromVisualTopmethod is used in a lot of contexts and I would prefer to not introduce any weird behavior due to magic constants.I would expect the "lower than" relation to be not affected by epsilon errors.
Thanks!
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.