Skip to content

fix direction of the start arrow marker in the layout polyline item (fix #59078) - #66558

Merged
alexbruy merged 3 commits into
qgis:masterfrom
alexbruy:layout-arrow-direction
Jul 2, 2026
Merged

fix direction of the start arrow marker in the layout polyline item (fix #59078)#66558
alexbruy merged 3 commits into
qgis:masterfrom
alexbruy:layout-arrow-direction

Conversation

@alexbruy

@alexbruy alexbruy commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Description

Layout arrow start marker points in the same direction as the end marker which is quite unexpected and inconsistent with other software where double-headed arrows point in the opposite directions. Also there is an inconsistency in arrow head positioning. The end arrow head is centered on the end point, while start arrow head points on the start point.

The rotation of the start arrow head is calculated using line heading from the start to the end while it should be the opposite, from the end to the start. The same rotation issue exists with the start SVG marker head.

As for the positioning, end arrow head takes into account arrow size and shifts position along the line direction to center arrow head on the end point. In case of the start arrow head we simply use start point without any offset.

Left — before, right — after.
arrows-direction

Fixes #59078.

AI tool usage

  • AI tool(s) (Copilot, Claude, or something similar) supported my development of this PR. See our policy about AI tool use. Use of AI tools must be indicated. Failure to be honest might result in banning.
@alexbruy alexbruy added Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks backport queued_ltr_backports Queued Backports backport release-3_44 labels Jun 24, 2026
@github-actions github-actions Bot added this to the 4.2.0 milestone Jun 24, 2026
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
To execute locally, unzip the downloaded zip file and run bin\qgis-bin.exe in the extracted directory.
You might be prompted by Windows Defender click "Run anyway"
(Built from commit 72cb4b6)

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This app is not notarized, run sudo xattr -d com.apple.quarantine /Applications/QGIS*.app to avoid the warning
(Built from commit 72cb4b6)

@github-actions

Copy link
Copy Markdown
Contributor

Tests failed for Qt 6 (ALL_BUT_PROVIDERS - fedora)

One or more tests failed using the build from commit 954a92b

polygon3d_extrusion_textured_metalrough_displacement1 (testExtrudedPolygonsMetalRoughTexturedShadingDisplacement)

polygon3d_extrusion_textured_metalrough_displacement1

Test failed at testExtrudedPolygonsMetalRoughTexturedShadingDisplacement at tests/src/3d/testqgs3dmaterialrendering.cpp:1010

Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_textured_metalrough_displacement1/expected_polygon3d_extrusion_textured_metalrough_displacement1.png (found 1293 pixels different)

The full test report (included comparison of rendered vs expected images) can be found here.

Further documentation on the QGIS test infrastructure can be found in the Developer's Guide.

@nyalldawson

Copy link
Copy Markdown
Collaborator

Doesn't this potentially break existing projects?

I think we'll need to add a "version" number to the item to handle this -- so only newly created arrows behave this way, and existing arrow items render as they did before

Only newly created arrows will have start and end arrow heads
looking in the opposite directions, keeping behavior of the existing
projects unchanged
@alexbruy

Copy link
Copy Markdown
Contributor Author

Added "version" to the layout polyline item. Not sure if we need it in the base class QgsLayoutItem.

Comment thread src/core/layout/qgslayoutitempolyline.h Outdated
@nyalldawson nyalldawson closed this Jul 2, 2026
@nyalldawson nyalldawson reopened this Jul 2, 2026
@alexbruy
alexbruy merged commit a79ac2e into qgis:master Jul 2, 2026
72 of 78 checks passed
@alexbruy
alexbruy deleted the layout-arrow-direction branch July 2, 2026 09:32
@qgis-bot

qgis-bot commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

The backport to queued_ltr_backports failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 954a92b9533... fix direction of the start arrow marker in the layout polyline item (fix #59078)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

stdout
Auto-merging src/core/layout/qgslayoutitempolyline.cpp
Auto-merging tests/src/python/test_qgslayoutpolyline.py
CONFLICT (content): Merge conflict in tests/src/python/test_qgslayoutpolyline.py

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-queued_ltr_backports queued_ltr_backports
# Navigate to the new working tree
cd .worktrees/backport-queued_ltr_backports
# Create a new branch
git switch --create backport-66558-to-queued_ltr_backports
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 954a92b9533c6014b225b0bcf0e68578286f8f52 e73142ebd83c83815aa555d16dc0252be242c654 72cb4b6e52cd3bc8fc78adbe63165abc902a7012
# Push it to GitHub
git push --set-upstream origin backport-66558-to-queued_ltr_backports
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-queued_ltr_backports

Then, create a pull request where the base branch is queued_ltr_backports and the compare/head branch is backport-66558-to-queued_ltr_backports.

@qgis-bot qgis-bot added the failed backport The automated backport attempt failed, needs a manual backport label Jul 2, 2026
@qgis-bot

qgis-bot commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

The backport to release-3_44 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 954a92b9533... fix direction of the start arrow marker in the layout polyline item (fix #59078)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

stdout
Auto-merging src/core/layout/qgslayoutitempolyline.cpp
Auto-merging tests/src/python/test_qgslayoutpolyline.py
CONFLICT (content): Merge conflict in tests/src/python/test_qgslayoutpolyline.py

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-3_44 release-3_44
# Navigate to the new working tree
cd .worktrees/backport-release-3_44
# Create a new branch
git switch --create backport-66558-to-release-3_44
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 954a92b9533c6014b225b0bcf0e68578286f8f52 e73142ebd83c83815aa555d16dc0252be242c654 72cb4b6e52cd3bc8fc78adbe63165abc902a7012
# Push it to GitHub
git push --set-upstream origin backport-66558-to-release-3_44
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-3_44

Then, create a pull request where the base branch is release-3_44 and the compare/head branch is backport-66558-to-release-3_44.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport queued_ltr_backports Queued Backports backport release-3_44 failed backport The automated backport attempt failed, needs a manual backport Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks

3 participants