Repository: flxzt/rnote (language: rust)

Issue:
Selecting objects with "Select One by One" doesn't allow to resize/rotate them
**Describe the bug**  
Selecting objects with "Select One by One" doesn't allow to resize them, **if** there's another object behind the resize square or the rotate circle.

This happens mainly when selecting images, since they usually occupy a big area.

**To Reproduce**  
_Here I go to the more error prone case_
Steps to reproduce the behavior:
1. Go to 'Selector'
2. Click on 'Select One by One'
3. Select a stroke over an image
4. Try to resize/rotate the selected stroke (you will select the image instead)

**Expected behavior**  
Resize/rotate the object instead of selecting whatever is behind it

**Console Output**  
Not necessary.

**Screenshots**  
<video src='https://github.com/user-attachments/assets/21a14624-fe6d-490f-a92f-866908ac4209' />

**Desktop (please complete the following information):**  
 - OS: Fedora 41
 - App Version: 0.11.0
 - Installation Source: Flatpak
 - Desktop Environment: Gnome 47
 - Display Server: Wayland
 - Input Source:Mouse, External Graphics Tablet

**Additional context**  
Add any other context about the problem here.



Discussion / hints:

Fix patch:
diff --git a/crates/rnote-engine/src/pens/selector/penevents.rs b/crates/rnote-engine/src/pens/selector/penevents.rs
index fe0597a84e..23063bb8e3 100644
--- a/crates/rnote-engine/src/pens/selector/penevents.rs
+++ b/crates/rnote-engine/src/pens/selector/penevents.rs
@@ -88,8 +88,7 @@ impl Selector {
                             )
                             .pop();
 
-                        if (engine_view.pens_config.selector_config.style == SelectorStyle::Single
-                            || modifier_keys.contains(&ModifierKey::KeyboardShift))
+                        if (modifier_keys.contains(&ModifierKey::KeyboardShift))
                             && key_to_add
                                 .and_then(|key| engine_view.store.selected(key).map(|s| !s))
                                 .unwrap_or(false)
@@ -169,6 +168,22 @@ impl Selector {
                                 start_pos: element.pos,
                                 last_rendered_bounds: *selection_bounds,
                             }
+                        } else if engine_view.pens_config.selector_config.style
+                            == SelectorStyle::Single
+                            && key_to_add
+                                .and_then(|key| engine_view.store.selected(key).map(|s| !s))
+                                .unwrap_or(false)
+                        {
+                            // defer the [SelectorStyle::Single] after checking whether we are
+                            // clicking on a selection node
+                            let key_to_add = key_to_add.unwrap();
+                            engine_view.store.set_selected(key_to_add, true);
+                            selection.push(key_to_add);
+                            if let Some(new_bounds) =
+                                engine_view.store.bounds_for_strokes(selection)
+                            {
+                                *selection_bounds = new_bounds;
+                            }
                         } else if selection_bounds.contains_local_point(&element.pos.into()) {
                             let snap_corner =
                                 SnapCorner::determine_from_bounds(*selection_bounds, element.pos);


Test patch: