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

Allow the Trim/Extend Tool to keep the reference line for multiple trim/extend actions #59676

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

YoannQDQ
Copy link
Contributor

@YoannQDQ YoannQDQ commented Nov 30, 2024

Description

Pressing Shift while trimming/extending a feature now keeps the reference feature.
Also fix the rubber band display when the layer crs != canvas crs.

trimextend

@github-actions github-actions bot added this to the 3.42.0 milestone Nov 30, 2024
@YoannQDQ YoannQDQ added Feature Digitizing Related to feature digitizing map tools or functionality labels Nov 30, 2024
Copy link

github-actions bot commented Dec 1, 2024

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 3c5b2c1)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 3c5b2c1)

@baswein
Copy link
Contributor

baswein commented Dec 2, 2024

Thanks for this amazing upgrade!

I just added a couple of semi related feature requests.
One that asks for an infinite line rubber band. #59683
In my ignorance I imagine this would be fairly straight forward as we already do it in a lot of places in QGIS.
And a much more involved one that suggests the ability to select multiple target segments.
#59685
While that feature is a long shot it would likely require either the ctrl or shift key to be used and it seems that you are utilizing both of them for this feature which makes me think we should reserve one of them for future features and options.

Also I think we should upgrade the tool tip help text to identify the modifier and that segment snapping is required to use the tool.
I'm happy to do that as a separate pull request as it is within my limited capabilities.

@lbartoletti lbartoletti self-assigned this Dec 2, 2024
Copy link
Member

@lbartoletti lbartoletti left a comment

Choose a reason for hiding this comment

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

Wonderful! I'd never taken the time to do that, and yet it was just a few lines of code! Many thanks.
Please can you add tests?

@lbartoletti lbartoletti added the Requires Tests! Waiting on the submitter to add unit tests before eligible for merging label Dec 2, 2024
@agiudiceandrea agiudiceandrea added the Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. label Dec 2, 2024
@qgis-bot
Copy link
Collaborator

qgis-bot commented Dec 2, 2024

@YoannQDQ
This pull request has been tagged as requiring documentation.

A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged.

Please update the description (not the comments) with helpful description and screenshot to help the work from documentors.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@lbartoletti lbartoletti removed the Requires Tests! Waiting on the submitter to add unit tests before eligible for merging label Dec 4, 2024
@nyalldawson
Copy link
Collaborator

@lbartoletti look acceptable to you?

@lbartoletti
Copy link
Member

@lbartoletti look acceptable to you?

Yes. Thanks @YoannQDQ

@lbartoletti lbartoletti merged commit eab9636 into qgis:master Dec 12, 2024
30 checks passed
@qgis-bot
Copy link
Collaborator

@YoannQDQ
A documentation ticket has been opened at qgis/QGIS-Documentation#9467
It is your responsibility to visit this ticket and add as much detail as possible for the documentation team to correctly document this change.
Thank you!

@qgis-bot
Copy link
Collaborator

The backport to release-3_34 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 97bdf48f3a5... Add test
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 advice.mergeConflict false"

stdout
Auto-merging src/app/qgsmaptooltrimextendfeature.cpp
[backport-59676-to-release-3_34 3e172c31606] Multi trim extend
 Author: Yoann Quenach de Quivillic <[email protected]>
 Date: Sun Dec 1 00:15:11 2024 +0100
 1 file changed, 6 insertions(+), 3 deletions(-)
Auto-merging tests/src/app/testqgsmaptooltrimextendfeature.cpp
CONFLICT (content): Merge conflict in tests/src/app/testqgsmaptooltrimextendfeature.cpp

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_34 release-3_34
# Navigate to the new working tree
cd .worktrees/backport-release-3_34
# Create a new branch
git switch --create backport-59676-to-release-3_34
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick b5f98cb2897f1ec326dd7cdc01da0c3778371517,97bdf48f3a508a4fd97abc7310eae4e556754786,3c5b2c112c4a89263497b9f66718f53f96f75c28
# Push it to GitHub
git push --set-upstream origin backport-59676-to-release-3_34
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-3_34

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

@qgis-bot qgis-bot added the failed backport The automated backport attempt failed, needs a manual backport label Dec 12, 2024
@DelazJ
Copy link
Contributor

DelazJ commented Dec 12, 2024

And a much more involved one that suggests the ability to select multiple target segments.
#59685
While that feature is a long shot it would likely require either the ctrl or shift key to be used and it seems that you are utilizing both of them for this feature which makes me think we should reserve one of them for future features and options.

@YoannQDQ How about the above suggestion? IMHO this is a valid reason to only use a single modifier. And I don't see the real need to use both, anyway.

@YoannQDQ YoannQDQ deleted the multi-trim-extend branch December 12, 2024 06:38
@YoannQDQ
Copy link
Contributor Author

I agree. Which one should we keep though? Shift or Ctrl? Thoughts @baswein?

@baswein
Copy link
Contributor

baswein commented Dec 12, 2024

I agree. Which one should we keep though? Shift or Ctrl? Thoughts @baswein?

I haven't noticed any particular pattern in QGIS that would suggest one over the other. I just don't want people to get used to using one and then have that be a conflict later. So... flipping a coin I vote for Shift.

@baswein
Copy link
Contributor

baswein commented Dec 16, 2024

I just noticed that the parentheses in your tool tip text are causing that portion of text to not be displayed on hover.
I tried using the xml entity code but got an error. Many of the other tool tips also have this problem as the have feature(s) in the name. Any ideas how to use parentheses in this situation?

@YoannQDQ
Copy link
Contributor Author

I just opened a PR that fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-3_40 Digitizing Related to feature digitizing map tools or functionality failed backport The automated backport attempt failed, needs a manual backport Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow the Trim/Extend Tool to keep the reference line for multiple trim/extend actions
7 participants