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

Fix Shape tools finishing prematurely #56157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

uclaros
Copy link
Contributor

@uclaros uclaros commented Feb 2, 2024

Description

Shape map tools would generate a new feature with no geometry when right click was pressed and fewer than necessary points were digitized.
Ideally we should make those tools complete digitizing with left mouse button too when enough points are gathered.

Also fixes #56106 crash

@uclaros uclaros added Bug Either a bug report, or a bug fix. Let's hope for the latter! Digitizing Related to feature digitizing map tools or functionality labels Feb 2, 2024
@github-actions github-actions bot added this to the 3.36.0 milestone Feb 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.

Thanks!

Copy link

github-actions bot commented Feb 2, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit bf1428e)

@@ -101,6 +101,12 @@ bool QgsMapToolShapeCircle2TangentsPoint::cadCanvasReleaseEvent( QgsMapMouseEven
}
else if ( e->button() == Qt::RightButton )
{
if ( mPoints.size() < 4 || mCircle.isEmpty() )
{
clean();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this mean if I right click after picking two points then those points are lost? I think ideally it'd just ignore the right click in that situation, not drop the existing points.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right clicking before we have enough points from the user means cancel in other digitizing tools too.
I'd consider this the same as create polygon with two vertices, or create line with a single vertex.
Why treat this differently?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's just a little unpredictable how these tools work -- as you've noted you have to left click a bunch of times, and then at some stage the left clicks start being ignored and you have to THEN do a right click. So if we abort when a right click happens before that magic threshold of left clicks is reached then it's really un user-friendly.

I think ideally the tools would give some indication of when the feature is valid and ready to be saved. Eg the rubber band becomes green or something at that stage...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd insist that in order to have predictable tools the right click should always result in either:

  • Finish digitizing if enough points are collected
  • Restart digitizing if not enough points are collected

This is how the main digitizing tools work, so those weird cousins should follow form.

Let's address the clunky ux in another pr. I'd suggest instead of coloring the rubberband, we add one more left click step that freezes the rubberband (ok, maybe change its color too) marking it as ready to finish. At this point the mouse does not update the rubberband any more and the user may either:

  • right click to finish
  • esc to reset
  • backspace/del to unfreeze/pick another last point

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Feb 27, 2024
@uclaros uclaros removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Feb 29, 2024
@qgis qgis deleted a comment from github-actions bot Feb 29, 2024
@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Mar 16, 2024
@github-actions github-actions bot closed this Mar 23, 2024
@nyalldawson nyalldawson reopened this Apr 15, 2024
@nyalldawson nyalldawson removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Apr 15, 2024
@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Apr 30, 2024
@github-actions github-actions bot closed this May 7, 2024
@qgis qgis deleted a comment from github-actions bot May 7, 2024
@qgis qgis deleted a comment from github-actions bot May 7, 2024
@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label May 7, 2024
@qgis qgis deleted a comment from github-actions bot May 7, 2024
@qgis qgis deleted a comment from github-actions bot May 7, 2024
@uclaros uclaros reopened this May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-3_34 backport release-3_36 Bug Either a bug report, or a bug fix. Let's hope for the latter! Digitizing Related to feature digitizing map tools or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash after right click during drawing shape annotations
3 participants