Factor out drawing map information label into a method#2857
Merged
vadi2 merged 1 commit intoMudlet:developmentfrom Jul 25, 2019
Merged
Factor out drawing map information label into a method#2857vadi2 merged 1 commit intoMudlet:developmentfrom
vadi2 merged 1 commit intoMudlet:developmentfrom
Conversation
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
Member
Author
|
Yep it's still a pretty big function, I agree with CodeFactor, but I don't want to do too many changes at once. |
SlySven
reviewed
Jul 25, 2019
| } else { | ||
| areaExit = false; | ||
| } | ||
| areaExit = pE->getArea() != mAreaID ? true : false; |
Member
There was a problem hiding this comment.
💡 No need for that ternary operator - the following is sufficient:
areaExit = (pE->getArea() != mAreaID);
SlySven
reviewed
Jul 25, 2019
Member
SlySven
left a comment
There was a problem hiding this comment.
I guess this is not as big a change as I at first worried it might be - and as it factors out a chunk of the massive T2DMap::paintEvent(...) it is worthwhile. 👍
Member
Author
|
Glad to hear you like it! I'd like to do a few more chunks like this out of it too - so it is easier to work with. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief overview of PR changes/additions
No functional changes.
Just create a separate
T2DMap::paintMapInfomethod sopaintEventisn't one giant mess and really hard to work with.This makes it much easier with profiling because we can now see how much painting the map info took in the overall picture:
And we can see how within the method we spend the time:
The overhead of calling the function is negligible when Qt's basic primitive paint functions take most of the time spent.
(credit to hotspot for profling)
Motivation for adding to Mudlet
Mapper code less scary, so more people are inclined to work with it! :)
Other info (issues closed, discussion etc)