Skip to content

Fix: Stop painting half of an exit line#5949

Merged
Kebap merged 1 commit intodevelopmentfrom
draw-whole-lines
Feb 4, 2022
Merged

Fix: Stop painting half of an exit line#5949
Kebap merged 1 commit intodevelopmentfrom
draw-whole-lines

Conversation

@Kebap
Copy link
Copy Markdown
Contributor

@Kebap Kebap commented Feb 3, 2022

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

@Kebap Kebap requested a review from a team as a code owner February 3, 2022 23:48
@Kebap Kebap requested a review from a team February 3, 2022 23:48
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Feb 3, 2022

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

@mudlet-machine-account mudlet-machine-account added this to the 4.16.0 milestone Feb 3, 2022
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 3, 2022

Messages
✔️

PR type: Fix

Generated by 🚫 dangerJS against 65d303d

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 3, 2022

clang-tidy review says "All clean, LGTM! 👍"

@Kebap Kebap merged commit b6bc200 into development Feb 4, 2022
@Kebap Kebap deleted the draw-whole-lines branch February 4, 2022 18:51
@Kebap Kebap restored the draw-whole-lines branch February 4, 2022 18:51
@Kebap Kebap deleted the draw-whole-lines branch February 4, 2022 18:51
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>
@vadi2 vadi2 modified the milestones: 4.16.0, 4.15.1 Feb 8, 2022
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.

4 participants