-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add top and bottom offset for content; Make horizontal scrollbar usable #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Now horizontal scrollbar doesn't interfere text editing and selection on last line (Before this change user can misclick on scrollbar instead of text line)
…g VerticalDrawOffset to class functions VerticalDrawOffset will be applyed to: - CalculateLinesToRender function - SearchHighlightsRenderer.RenderHighlights (OffsetTop param) - CanvasDrawingSession.DrawTextLayout (Y param) - invisibleCharactersRenderer.DrawTabsAndSpaces (singleLineHeight param) Also: - UpdateScrollOffset function will be added for handle control vertical scroll offset changing - float VerticalDrawOffset variable (default value is 0) - double TopScrollOffset and BottomScrollOffset variables
…p of cursor position formula
…if ContentVerticalScrollOffset property changed
…set management easier
…ing; Make TopScrollOffset and BottomScrollOffset field public for get Code refactor: - Move offset calculating logic to local function
Fixed bug: - When cursor located out of viewport local offset not applied to vertical scroll value
|
Looks pretty good. This problem always annoyed me as well, thanks for your fix🙏🏻. |
|
I refactored small parts of your code, but I spotted some problems. My changes are in a new pull request About the problems I found:
I will close this Pull request, lets continue from the new one for now. |
Top and bottom offset for content
If this control will be used with some flyouts (like search-replace flyout) content offset may be useful
For example modern notepad application
I'm not good c# developer, but for a first look that works without any bugs. Also I worry about performance - my formulas may be not optimized
Make horizontal scrollbar usable
9cca937
Right now user can't normally edit line under scrollbar (If user enable "Always show scrollbars" in settings that line cannot be edited). If line is last editing is not possible.
How it look before
User can't access line 45
How it look after
User can access any line without problems