Skip to content
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

AutoScroll off-by-one line at bottom of scroll area #85

Open
SlySven opened this issue Apr 5, 2019 · 0 comments
Open

AutoScroll off-by-one line at bottom of scroll area #85

SlySven opened this issue Apr 5, 2019 · 0 comments

Comments

@SlySven
Copy link
Contributor

SlySven commented Apr 5, 2019

After applying #84 and setting the margin to zero I find that it is possible for the cursor to completely disappear off the bottom of the viewpoint as if the point that is being checked to see if it is still visible is the very top of the rectangular area that comprises each glyph. After checking more closely I can see that the same thing applies when the cursor goes off to the right of the scroll area but it is less obvious (probably because the particular size and font size I was using during testing meant that the scroll area was not an exact multiple of the font width and height but the height had the smaller mismatch!)

I suspect that the check for whether the something is visible is only checking one point in (void) TextEditorWidget::scrollPositionVisible(int xPosIn, int yPosIn) whereas it should check the diagonally opposite corners of the I-cursor (or perhaps the character before/after and the top/bottom of the row it is in depending on which way the cursor has last moved? 🤷‍♂️)

I had actually extended PR 84 to work with a QSize instead so that the horizontal and vertical margins could be set separately but I had set them to the same value (zero) when I found this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant