Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to dynamically tweak dash pattern in simple line symbol layers #37840

Merged
merged 10 commits into from
Jul 24, 2020

Conversation

nyalldawson
Copy link
Collaborator

New options are:

  • Align dash pattern to line length: If checked, the dash pattern lengths
    will be subtely adjusted in order to ensure that when a line is rendered
    it will end with a complete dash element, instead of a gap element or
    partial dash element

  • Tweak dash pattern at sharp corners: If checked, this option dynamically
    adjusts the dash pattern placement so that sharp corners are represented
    by a full dash element coming into and out of the sharp corner. It's designed
    to better represent the underlying geometry while rendering dashed lines,
    especially for jagged lines

Screenshots:

Before, showing yellow lines at actual start and end of features -- the dash pattern ends with a gap, which hides the true length of the line:

image

With the new "Align dash pattern to line length" option checked:

image

Here's an animation showing the new "tweak dash pattern at sharp corners" option being toggled:

Peek 2020-07-16 15-25

@nyalldawson nyalldawson added Feature Symbology Related to vector layer symbology or renderers labels Jul 16, 2020
@github-actions github-actions bot added this to the 3.16.0 milestone Jul 16, 2020
@zacharlie zacharlie added the Changelog Items that are queued to appear in the visual changelog - remove after harvesting label Jul 16, 2020
@nyalldawson nyalldawson force-pushed the line_pattern_dash branch 2 times, most recently from 65b810d to 0d791bb Compare July 21, 2020 23:17
Copy link
Contributor

@nirvn nirvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'll come in handy.

src/core/symbology/qgslinesymbollayer.cpp Outdated Show resolved Hide resolved
src/core/symbology/qgssymbollayerutils.h Show resolved Hide resolved
src/gui/symbology/qgssymbollayerwidget.cpp Outdated Show resolved Hide resolved
in simple line symbol layers

New options are:

- Align dash pattern to line length: If checked, the dash pattern lengths
will be subtely adjusted in order to ensure that when a line is rendered
it will end with a complete dash element, instead of a gap element or
partial dash element

- Tweak dash pattern at sharp corners: If checked, this option dynamically
adjusts the dash pattern placement so that sharp corners are represented
by a full dash element coming into and out of the sharp corner. It's designed
to better represent the underlying geometry while rendering dashed lines,
especially for jagged lines
@nyalldawson
Copy link
Collaborator Author

Thanks for the review @nirvn!

@nyalldawson nyalldawson merged commit b6ae643 into qgis:master Jul 24, 2020
@nyalldawson nyalldawson deleted the line_pattern_dash branch July 24, 2020 02:59
@zacharlie zacharlie added ChangelogHarvested This PR description has been harvested in the Changelog already. and removed Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ChangelogHarvested This PR description has been harvested in the Changelog already. Feature Symbology Related to vector layer symbology or renderers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants