Skip to content

Bugfix: equalizes mouse-drag scroll margins on TConsoles#366

Merged
vadi2 merged 1 commit intoMudlet:developmentfrom
dicene:scrollMarginFix
Jan 18, 2017
Merged

Bugfix: equalizes mouse-drag scroll margins on TConsoles#366
vadi2 merged 1 commit intoMudlet:developmentfrom
dicene:scrollMarginFix

Conversation

@dicene
Copy link
Copy Markdown
Contributor

@dicene dicene commented Jan 4, 2017

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.

This set of conditionals was uneven. Because height() is not zero-based,
the scrollDown margin was 9.
@dicene dicene changed the title Fix: equalizes mouse-drag scroll margins Bugfix: equalizes mouse-drag scroll margins Jan 4, 2017
@dicene dicene changed the title Bugfix: equalizes mouse-drag scroll margins Bugfix: equalizes mouse-drag scroll margins on TConsoles Jan 4, 2017
@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Jan 5, 2017

How can I test the fix?

@dicene
Copy link
Copy Markdown
Contributor Author

dicene commented Jan 5, 2017

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. 🤔

@dicene
Copy link
Copy Markdown
Contributor Author

dicene commented Jan 6, 2017

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.

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Jan 6, 2017

I'm just not sure what is this fixing to - the scrollbar position in the consoles or?

@dicene
Copy link
Copy Markdown
Contributor Author

dicene commented Jan 6, 2017

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.

@SlySven
Copy link
Copy Markdown
Member

SlySven commented Jan 17, 2017

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"}...

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Jan 18, 2017

Yeah, it's a bugfix, should go into release_30.

@vadi2 vadi2 merged commit 043692e into Mudlet:development Jan 18, 2017
@dicene dicene deleted the scrollMarginFix branch March 8, 2017 02:54
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

Successfully merging this pull request may close these issues.

3 participants