Bug report #18622
Mouse pointer displacement
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | OsX UI | ||
Affected QGIS version: | 3.0.0 | Regression?: | No |
Operating System: | MacOS | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 26510 |
Description
In QGIS 3 there is a new mouse pointer when digitizing which looks nice. Unfortunately it's not centered on the drawing pixel. See attached image.
History
#1 Updated by Nyall Dawson over 6 years ago
Issue is specific to OSX, likely a result of forced pixel doubling setting on that platform.
#2 Updated by Dewey Dunnington over 6 years ago
I have noticed this as well. The Select, Zoom (in and out), and Digitizing (crosshairs) pointers are twice as big (ish) as they used to be, if this is related. The Pan and crosshairs for node moving appear to be the right size (and the crosshairs pointer for the node moving tool is properly centred).
#3 Updated by Rhenriques Henriques over 6 years ago
This bug it's not solved yet. It works great in 2.18. It seems to be a regression, at least in MacOS
#4 Updated by Oskar Karlin over 6 years ago
Anyone planning on doing something about this?
#5 Updated by Giovanni Manghi over 6 years ago
- Category changed from GUI to OsX UI
#6 Updated by Mars Sjoden about 6 years ago
Oskar Karlin wrote:
... Unfortunately it's not centered on the drawing pixel...
Confirmed, 3.x.x makes for difficulty in precise digitizing. This results in requiring many more node adjustments.
#7 Updated by Alessandro Pasotti about 6 years ago
- Status changed from Open to Feedback
Can you please make this test?
When digitizing, open the python console and type the following:
from qgis.PyQt import QtCore QgsApplication.setOverrideCursor(QtCore.Qt.CrossCursor)
Does the cursor change to a simple crosshair?
How does it look?
Does the problem go away with this type of cursor?
#8 Updated by Alessandro Pasotti about 6 years ago
Forgot to mention, to restore original cursor:
QgsApplication.restoreOverrideCursor()
#9 Updated by Philipe Borba about 6 years ago
Alessandro Pasotti wrote:
Can you please make this test?
When digitizing, open the python console and type the following:
[...]
Does the cursor change to a simple crosshair?
How does it look?
Does the problem go away with this type of cursor?
Yes, when we set the cursor as the CrossCursor, it gets the regular size, but when we use the digitise tool, the crosshair is huge
#10 Updated by Alessandro Pasotti about 6 years ago
@Philippe, this ticket is about displacement, not size, what you need to check is if after a click the point/vertex is added at the center of the cursor or not.
If you have an issue with size, then please open a separate ticket, and have a look at https://github.com/qgis/QGIS/pull/5939 , you may want to resurrect it.
#11 Updated by Konrad Lawson about 6 years ago
Alessandro Pasotti wrote:
Can you please make this test?
When digitizing, open the python console and type the following:
[...]
Does the cursor change to a simple crosshair?
How does it look?
Does the problem go away with this type of cursor?
Alessandro - thanks so much for this workaround. I can confirm that
a) in my case (QGIS 3.2, OSX High Sierra, Python 3.6.5) too the cross hair with circle cursor is displaced, so that the top left of the cursor rather than the center of is the location of the click
b) if, before digitizing my points, I enter your two lines into the python console:
from qgis.PyQt import QtCore
QgsApplication.setOverrideCursor(QtCore.Qt.CrossCursor)
Then the cursor changes to a simple cross hair (without the circle around it) and clicks are produced correctly at the center of the cursor. That is great. Any chance that this cursor (or a fixed original one) can be set for future releases so we don't need to run this when we digitize?
#12 Updated by Alessandro Pasotti about 6 years ago
Of course this needs to be fixed, we have only a few MacOS developers (and I'm not one of them) so this could take some time.
If a real fix could not be found in time for 3.4 we might consider (as a workaround for Mac only) to return the stock Qt cursors instead of the advanced svg scalable cursors (that are HiDPI friendly on Linux and Windows).
In the meantime, it would be very useful if you could test the latest master builds of QGIS to make sure the problem was not already solved.
Also, I suppose that other cursor are affected as well, can you please check the color picker, the identify and the selection cursor (the last two are probably unaffected because the active point is in the top left corner).
#13 Updated by Konrad Lawson about 6 years ago
Thanks Alessandro,
I'm running 3.2.3 now.
I can confirm that there is a similar problem for the color picker cursor (which looks like it should have active point at top left, but in fact, only activates a color about 1/5 of the way into the center of the cursor.
There are no problems with identity and selection cursor, though, as mentioned by others, they are abnormally large (separate issue).
Is this a problem of QtCursor? I'm not an experienced Qt developer but I would be happy to poke about in Qt forums for reports of similar issues but would be nice to have a hint as to where in the QGIS repository the code might lie for the cursor calls.
#14 Updated by Alessandro Pasotti about 6 years ago
Hi Konrad, the color picker is odd because it has a transparent area that is supposed to take the color of the background (like when you "suck" a colored liquid with the pipette), so the active point is NOT at the top left corner.
See the implementation here:
https://github.com/qgis/QGIS/blob/master/src/core/qgsapplication.cpp#L542
BTW I see that there is already a custom code for Mac, but it looks plain wrong to me because it sets the same active point for all cursors (but as I said I cannot build and test on Mac).
#15 Updated by THIERRY GEYER about 6 years ago
Hi Alessandro !
This script is a relief.
I was struggling since month now with this issue and couldn't use Qgis 3 on mac.
Digitising with a big decentred crosshair was just impossible.
Looking forward for a permanent solution.
Many thanks !
#16 Updated by Konrad Lawson about 6 years ago
Hello everyone, I can confirm that this problem has disappeared for me in the new QGIS 3.4. The active pixel is correct for digitization, and the cursor also looks normal size.
The color sampler cursor is behaving a bit strange but the main problem with the cross hair is gone. Many thanks!
#17 Updated by Giovanni Manghi about 6 years ago
- Status changed from Feedback to Closed
- Resolution set to fixed/implemented