Fix: Stop painting half of an exit line#5949
Merged
Kebap merged 1 commit intodevelopmentfrom Feb 4, 2022
Merged
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. |
Contributor
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Delwing
approved these changes
Feb 4, 2022
SlySven
added a commit
to SlySven/Mudlet
that referenced
this pull request
Feb 5, 2022
I conceived of this without being aware that the change in part of Mudlet#4608 that stopped drawing the entire exit line between two rooms both visible in the mapper twice (once for each room) had been reverted by Mudlet#5949. This is a suggested alternative that goes back to drawing the half a line from each room towards the other room but additionally draws the other section stating as fully opaque but fading to transparent at the far room. If both rooms are visible this will be hidden by the corresponding fully visible exit line from the other room - but not if not. It is a bit more complex to do than might be first thought because the `QPainter::drawLine(...)` methods only use the `QPainter`'s pen (otherwise used to draw the outline of a shape) and a gradient shading effect only applies to the brush (fill) of a shape. This means that the line has to be constructed as a rectangle - and to draw it at an angle it needs to be done with `QPainter::drawPolyon(...)` using a `QLinearGradient` as the brush and no pen. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
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
Draw a whole line even if one room at its end is not currently shown
Motivation for adding to Mudlet
Lines half vanished suddenly while scrolling the map. Lines stop in the middle of nowhere.
Original bug report in Mudlet discord on 2022/02/03
Other info (issues closed, discussion etc)
Discussion starts here: https://discord.com/channels/283581582550237184/283582439002210305/938888418186903664
Release post highlight