{"action":"created","issue":{"url":"https://api.github.com/repos/icsharpcode/AvalonEdit/issues/45","labels_url":"https://api.github.com/repos/icsharpcode/AvalonEdit/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/icsharpcode/AvalonEdit/issues/45/comments","events_url":"https://api.github.com/repos/icsharpcode/AvalonEdit/issues/45/events","html_url":"https://github.com/icsharpcode/AvalonEdit/issues/45","id":72990095,"number":45,"title":"Make Y offset to be a multiple of line height","user":{"login":"nippur72","id":2598443,"avatar_url":"https://avatars.githubusercontent.com/u/2598443?v=3","gravatar_id":"","url":"https://api.github.com/users/nippur72","html_url":"https://github.com/nippur72","followers_url":"https://api.github.com/users/nippur72/followers","following_url":"https://api.github.com/users/nippur72/following{/other_user}","gists_url":"https://api.github.com/users/nippur72/gists{/gist_id}","starred_url":"https://api.github.com/users/nippur72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nippur72/subscriptions","organizations_url":"https://api.github.com/users/nippur72/orgs","repos_url":"https://api.github.com/users/nippur72/repos","events_url":"https://api.github.com/users/nippur72/events{/privacy}","received_events_url":"https://api.github.com/users/nippur72/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-04T10:52:36Z","updated_at":"2015-05-11T10:49:38Z","closed_at":null,"body":"There is a possible incorrect behavior I've found I would like to discuss: \r\n\r\nWhen you navigate with `page down`, the caret is forced into view by `TextView.MakeVisible()`, but that often makes the scroll Y offset to be unaligned respect to text lines, causing a partially covered top line (very noticeable with big fonts).\r\n\r\nIMO, the correct behavior should be forcing `newScrollOffset.Y` to be a perfect multiple of `DefaultLineHeight`, so that the first line is always \"in sync\". This is what all other editors mostly do (e.g. VS). \r\n\r\nI was thinking something like this:\r\n```C#\r\nnewScrollOffset.Y = Math.Floor(newScrollOffset.Y / DefaultLineHeight) * DefaultLineHeight;\r\n```\r\n\r\nBut I don't know if that fix is correct to, because of this `DefaultLineHeight` comment:\r\n```C#\r\n/// Gets the default line height. This is the height of an empty line or a line containing regular text.\r\n/// Lines that include formatted text or custom UI elements may have a different line height.\r\n```\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/icsharpcode/AvalonEdit/issues/comments/100867432","html_url":"https://github.com/icsharpcode/AvalonEdit/issues/45#issuecomment-100867432","issue_url":"https://api.github.com/repos/icsharpcode/AvalonEdit/issues/45","id":100867432,"user":{"login":"nippur72","id":2598443,"avatar_url":"https://avatars.githubusercontent.com/u/2598443?v=3","gravatar_id":"","url":"https://api.github.com/users/nippur72","html_url":"https://github.com/nippur72","followers_url":"https://api.github.com/users/nippur72/followers","following_url":"https://api.github.com/users/nippur72/following{/other_user}","gists_url":"https://api.github.com/users/nippur72/gists{/gist_id}","starred_url":"https://api.github.com/users/nippur72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nippur72/subscriptions","organizations_url":"https://api.github.com/users/nippur72/orgs","repos_url":"https://api.github.com/users/nippur72/repos","events_url":"https://api.github.com/users/nippur72/events{/privacy}","received_events_url":"https://api.github.com/users/nippur72/received_events","type":"User","site_admin":false},"created_at":"2015-05-11T10:49:38Z","updated_at":"2015-05-11T10:49:38Z","body":"Ok, I made another fix, I've moved the alignment operation within `IScrollInfo.SetVerticalOffset()`,\r\nso that every change in Y offset is aligned with `DefaultLineHeight`. Seem to work better than before. "}}