-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
In georeferencer, allow to move and delete GCPs without perfect aiming #37256
Conversation
Nice, that's a nice PITA taken care of. |
// This is the manhattan length from mouse cursor point to GCP | ||
// We will use this distance to pick the closest GCP to the cursor | ||
// GCPs farther than the initial minDistance are too far and are ignored | ||
qreal minDistance = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of the hardcoded value -- could we use QgsMapTool::searchRadiusMU/QgsMapTool::searchRadiusMM() instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could, but is there a real benefit from it?
AFAICT, searchRadiusMM
is pretty much tied to the identify tool, so the options and code comment descriptions will have to be adapted too.
I can imagine someone raising this value to identify multiple features at once, or minimizing it for better identify precision, and then struggle with the georeferencer and his strange searchRadiusMM
value choice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm - I think we need an equivalent central method for map editing tools then. My concern with a hardcoded pixel value is that it's going to be completely inappropriate for certain setups (e.g. hidpi screens). We need something which accounts for dpi also, which is why a mm based size would be preferable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also the Search radius for vertex edits setting (/qgis/digitizing/search_radius_vertex_edit
) that looks more appropriate, but it can also be set for map units which makes no sense for the georeferencer case...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nyalldawson I think the easiest solution is to just set the hardcoded value to a larger number if 10 is too small for hidpi displays (I cannot test).
A too small value will make the tool function like it does now, needing better aiming from the user.
A slightly large value will cause no real issue, since the GCP closest to the click point will be moved, the user will still expect this GCP to be moved.
A huge value could be a little strange as the closest GCP might be very far from the click position and the user might not make the connection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave qreal minDistance = mCanvas->physicalDpiX() / 10;
a shot and it works nice though slightly different on each of my two displays. Could you please test it on a hidpi setup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gives around 7mm radius here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also get around 7mm on a 24" 1920x1080 display and around 3mm on a 13" 1366x768 display.
Both values are very usable, way better than the current 0.1mm imho! =p
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having involving dpi is a very good thing. And the number 10
should be configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if it's configurable then there is no need for it to be dpi dependent, is it?
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
976e624
to
1fb0b3e
Compare
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
Do you think this is on the right track? Should I un-stale it or should I let it go? |
I think this is on a good track. But we need the factor (10) to be configurable (visual impairment or other specific environment). Still for a good default value or multi screen setups the dpi needs to be taken into account. I.e. the config should reflect distance in mm, not pixels. Ideally this is shared with another setting as discussed earlier. |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
Giving this a last look before abandoning and noticed there could be a much simpler approach: |
|
Can you remind me what's wrong with physicalDpi? |
One problem is it does not work as I expected, I might be misunderstanding something: Furthermore, I came to realize that we do not want this distance to be in mm. We want this distance to be measured in the smallest unit of the feedback of the user's interaction, ie the smallest distance one can move the mouse and see it moving on the screen. |
Use proper distance instead of manhattan length Scale pixel distance by mCanvas->devicePixelRatioF()
1fb0b3e
to
a1affc8
Compare
devicePixelRatio is 1.0 here despite the HiDpi screen. This might be a local configuration issue though.
P.S.
I dare to challenge this statement. When a user is aiming for a point, it's his eye and hand which are the limitation. These sensors don't work in pixels, they work in real world distances. So we want the setting and default value to be in mm and the computer calculate the equivalent in pixels for us. |
I do not agree. The hand and mouse sensor works in real world distances indeed, but it's all pixels once the pointer is displayed on the screen! You can see the mouse move less than a mm but you cannot see the mouse pointer move less than one pixel. |
Are you sure that's how things work? I.e. the higher the physical dpi the slower your mouse moves on the screen? |
AFAIK, same distance traveled by the mouse on the mouse pad results in same pixels traveled by the pointer on the screen, regardless of screen size or resolution (granted that no mouse acceleration setting is enabled of course). |
Even if this is true, the main reason for me stays visual recognition. What I perceive as "close enogh to snap" is not related to pixels. |
It definitely is. If 10mm was your close enough to snap, would you be able to operate on a concert video wall where pixels are 10mm apart? |
You are right,it's not perfect. But still better than px for the average everyday gis scenario I guess? And I cannot see a perfect solution unfortunately. |
I am sorry, but I completely disagree. If it was in any way better than px then snapping tolerance would have been implemented in screen mm instead of px. Same for qt buttons and menus and widgets in general. |
@uclaros that's not quite right -- a lot of this stuff was in place from way before hidpi was even a concept, so we can't take past decisions as correct here. For reference, all the qt docs describe best practice as basing screen sizes on font metrics (ie real world units like mm) instead of pixels. |
I don't think that is so. Font metrics actually mean pixels, after any scaling done by the os or the display driver. Hence, |
Font metrics return pixels, but they are converted from fixed values in terms of character sizes (in real world units). That's why they are used as a conversion route from "how big should things actually appear on the screen" to "what size does this correspond to in pixels" |
Wouldn't then a |
@uclaros you omit the font size -- ie.
that uses the default application font sizing then -- so basically ui elements and measurements are effectively specified in "multiple of menu/standard widget height" units. The thinking there is that for a videowall the user will have already set the default font size to a suitable size, using whatever scaling factors/dpi/font size settings their particular operating system offers. |
Maybe I'm tired, but I still do not see where real world units are. Isn't the default application font defined by the application itself, regardless of display? |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist. |
Description
In the georeferencer, one has to aim frustratingly good in order to use the Delete GCP and Move GCP point tool.
This PR fixes this by allowing a manhattan distance of 10 between the mouse cursor and the actual GCP, similarly to the way the vertex tool works.
QgsGeorefDataPoint::contains
is no longer used; should I remove it?