Bugfix: equalizes mouse-drag scroll margins on TConsoles#366
Bugfix: equalizes mouse-drag scroll margins on TConsoles#366vadi2 merged 1 commit intoMudlet:developmentfrom
Conversation
This set of conditionals was uneven. Because height() is not zero-based, the scrollDown margin was 9.
|
How can I test the fix? |
|
That's a good question. I'd say that if you're not sure that the logic is adding up, you could test the conditional by doing a for-loop of possible values? Other than that, the other way would be to set up something like an autohotkey script that enables you to move the mouse via your keyboard or something so you can check individual pixels? Kinda tricky, I know. 🤔 |
|
I think it'd also be possible with some very copious use of QDebug to track the mouse position and whether or not it is choosing to scroll based on that mouse position. |
|
I'm just not sure what is this fixing to - the scrollbar position in the consoles or? |
|
It's a spot of code in the function that fires when the mouse is dragged on a console. The code is supposed to scroll the console up or down when you're within 10 pixels of the top/bottom of the console. I noticed though while reading through the function, the conditional that determines when to scroll down was only matching for 9 pixels at the bottom, compared to 10 at the top. The fix is to correct that conditional so that the margin at the bottom is the same as the margin at the top. |
|
I do not have an issue with this if the maths adds-up - which, as it didn't, was what prompted this PR anyhow. 😉 👍 Technically it is a bugfix and it should be trivial to port it into https://github.com/Mudlet/Mudlet/tree/release_30 but if "you don't fix it you ain't gonna break it any more..." Edited: 👋 @dicene - can you port this one then to the other branch. {Prepare a PR based on you branching in your repo the current release_30 branch with the same change "cherry-picked" on to it - suggested title for the PR "(release_30)added: ctrl/timestamp + click to select entire lines"}... |
|
Yeah, it's a bugfix, should go into release_30. |
The set of conditionals that control when the mouse is close enough to the edge to scroll a console was uneven. Because height() is not zero-based, the scrollDown margin was 9.