Object directly under cursor not selectable due to "grab sensitivity" of objects of higher z-order
Migrated from https://bugs.launchpad.net/inkscape/+bug/515997
Steps to reproduce:
- open the attached file and view it at 50%
- click the blue rectangle
What happened?
The red rectangle is selected instead
What should have happened?
The blue rectangle is selected
This is a very old and often-reported bug with the grab sensitivity, but I haven't found it on GitLab yet (Technically not a bug but a feature, but still very annoying in some cases)
See:
- https://bugs.launchpad.net/inkscape/+bug/515997
- https://bugs.launchpad.net/inkscape/+bug/671532
- https://bugs.launchpad.net/inkscape/+bug/1679978
- https://bugs.launchpad.net/inkscape/+bug/1684106
- https://bugs.launchpad.net/inkscape/+bug/1781898
The following solution is suggested:
Selection preference:
- at least one selectable* object directly under cursor (distance = 0): select highest of these objects. No selectable object can happen if:
- All objects under the cursor are locked or hidden
- All objects under the cursor are in a layer or group which is locked or hidden
- There are in-fact no objects at all under the cursor.
- no object directly under cursor, but at least one object within sensitivity region (distance > 0): select object with the lowest distance, if distance if two objects is equal, select highest object -> prefer objects directly below the cursor to objects above, where the curser lies only in the sensitivity area
There is an additional idea in this thread, regarding the "cycling through objects in z-order" with the Alt-Button pressed (by Emanuele Sabetta). Should probably be opened as a separate issue, just so it's not forgotten:
PROBLEM: I find the CLICK+ALT option to cycle between the z-ordered objects insufficient. Often there are many objects stacked one over another with the same size, with transparency and other filters applied, and just looking at the outline is not enough to distinguish them.
SOLUTION: Add a new key combination (i.e. CLICK+ALT+Z) that allow to select the objects from a dialog box with the list of all objects found stacked under the mouse cursor. This dialog box can be called "LOCAL Z-ORDERED OBJECT LIST" or "LOCAL OBJECTS Z HIERARCHY", and it should display as a popup dialog near the point where the user clicked. When the user move the mouse on the list entries, while hovering on each object name or id it should hilight the name and at the same time displaying only the hilighted object (or group) on the Inkscape drawing, hiding all other objects (or groups) of the svg tree. This way it is possible to see what object (or group) we are selecting instead of blindly selecting an invisible shape. Then just clicking on the name on the z ordered list of stacked objects would select the object and close the dialog box. If the SHIFT or CTRL modifiers are used, the behaviour it is exactly the same. The only difference is:
With the SHIFT modifier: all already selected objects are hidden like the others, but they are tagged in the list with a small icon indicating that they have been already selected. This way the user knows that if he click again on those objects names they will be deselected. Also when SHIFT is pressed the dialog box is not closed when the user click on an entry, but multiple selection is allowed inside the list and to close the dialog box the user should press an explicit "Close" or "X" button on the dialog box.
With the CTRL modifier: instead of listing the groups as single entries, the dialog box lists explicitly all objects inside the groups. When the mouse goes over the listed name of an object inside a group, only the hilighted object is shown and all the other objects of the same group are hidden from the Inkscape drawing.
Inkscape Version and Operating System:
- Inkscape Version: 1.1-dev (3322b9c, 2019-12-31)
- Operating System: Windows 10
- Operating System version: 10.0.18362
Example file: