Search Issue Tracker
Won't Fix
Unknown (hidden) 2021.1.X, 2021.3.X, 2022.2.X, 2023.1.X
Votes
0
Found in
2021.1.11f1
2021.3.7f1
2022.2.0b3
2023.1.0a4
Issue ID
UUM-10034
Regression
Yes
”Handles.PositionHandle” can’t be moved when the cursor is on top of it
How to reproduce:
1. Open project “EditorWindowHandlesTest.zip”
2. Open Menu > Window > Handles tester
3. Move handles and observe the result
Expected result: Handles can be moved when the cursor is on them
Actual result: Handles can be moved when the cursor has an offset to the top right
Reproducible with: 2021.2.0a17, 2021.3.7f1, 2021.1.11f1, 2022.2.0b3, 2023.1.0a4
Not reproducible with: 2020.3.37f1, 2021.2.0a16
Reproduced on: macOS 12.4 (Intel)
Note: Thin part of a handle is not registering the cursor
Comments (3)
-
Grhyll
Oct 03, 2022 15:02
Because the example sample is very simple (the preview rect is in the top right corner of the window), it's actually just a bit more complicated than what I though, but I think I've mosty found a good workaround:
- I run all my handles code twice (just the parts calling stuff like Handles.PositionHandle) (except during Repaint events where I only call it once so that it doesn't get drawn twice)
- With all the previous code untouched (including the calculations on lastRepaintCameraRect), on the first call I set my cursor position this way:
Vector2 newMousePosition = baseMousePosition + new Vector2(-lastRepaintCameraRect.x, lastRepaintCameraRect.y + lastRepaintCameraRect.height - position.height);
newMousePosition.y -= 22f;
Event.current.mousePosition = newMousePosition;And for the second call:
newMousePosition = baseMousePosition + new Vector2(-lastRepaintCameraRect.x, lastRepaintCameraRect.y);
newMousePosition.y -= 22f;
Event.current.mousePosition = newMousePosition;It does have several downsides though (the handle doesn't feedback the use of the arrows tips, and I also have invisible flying handles at various offsets from the visible ones).
-
Grhyll
Oct 03, 2022 10:06
After further investigation, it looks like the plane handles and arrows body (not the tip) respond correctly when only offsetting the Event.current.mousePosition by the window's header height.
So as far as I understand it, in the previous versions, all parts of the handles respond to the mouse position being offsetted as it is in the provided code; but in the earlier versions, only the arrows tips still need that offset, and all other parts of the handle now respond to the normal cursor position with a slight offset.This code works for the arrows tips:
Vector2 newMousePosition = Event.current.mousePosition + new Vector2(-lastRepaintCameraRect.x, lastRepaintCameraRect.y);
newMousePosition.y -= 22f; // Empirical height of the window
Event.current.mousePosition = newMousePosition;And for the rest of the handle:
newMousePosition = Event.current.mousePosition;
newMousePosition.y -= 22f; // Empirical height of the window
Event.current.mousePosition = newMousePosition; -
Grhyll
Oct 03, 2022 09:30
Please note that the squares at the root of the arrows (to move the handle along a plane) aren't registering the cursor at all either.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- The Scrollbar becomes unusable when adding Elements to the List
- "One or more data file missing for baking set NewScene Baking Set. Cannot load shared data." error in Player when a specific project is built
- Choosing new HDR Colour using RGB values breaks colour on Intensity Selectors
- Rendering/Decal Layer Mask options are different inside Prefab Mode and outside Prefab Mode when the project is upgraded to Unity 6
- Incorrect Realtime GI Light Probes baking when more than one Light Probe Group is used and "Baked Global Illumination" is enabled
Resolution Note:
Handles outside of the Scene View are not a supported workflow.