SonyWWS / ATF

Authoring Tools Framework (ATF) is a set of C#/.NET components for making tools on Windows. ATF has been in continuous development in Sony Computer Entertainment's (SCE) Worldwide Studios central tools group since early 2005. ATF has been used by most SCE first party studios to make many custom tools such as Naughty Dog’s level editor and shader editor for The Last of Us, Guerrilla Games’ sequence editor for Killzone games (including the Killzone: Shadow Fall PS4 launch title), an animation blending tool at Santa Monica Studio, a level editor at Bend Studio, a visual state machine editor for Quantic Dream, sound editing tools, and many others.
Apache License 2.0
1.89k stars 262 forks source link

Groups of groups picking issues #17

Closed vkashkash closed 10 years ago

vkashkash commented 10 years ago

Hello,

I am using the CircuitEditor example and I am trying to resize a group within a group. When moving the cursor on the right side I get the resize cursor; however, upon attempting to resize, the group moves instead of resizing. In D2dCircuitRenderer.cs for the function GraphHitRecord, it seems like pickedElement always stays with the parent group instead of the child group. The value in subPick.First actually does contain the sub-group. The following code looks like it fixes the issue:

if (pickedElement != null && subPick.First != null) { pickedElement = subPick.First.First().Cast(); }

Is this the correct solution or am I misunderstanding how GraphHitRecord is supposed to work?

Thanks

jhshen commented 10 years ago

Thanks for reporting the nested group manually resizing problem. The suggested code may not be ideal, since pickedElement is usually used for top-level element, and we have separate fields in the hit record for sub-item/part selection. Some of our clients have custom highlighting for the active group hierarchical selection path so it is better to keep the pickedElement for the top-level elements.

I have submitted a fix for Ron to review. It should be checked into GitHub by tomorrow.

Shen

jhshen commented 10 years ago

Ron has checked in the fix. Please verify the change fixed your problem. Thanks.

Shen

vkashkash commented 10 years ago

Thanks for the quick turnaround. The fix seems to work in most cases, but there is still an issue. I wish to have certain nodes not have the ability to be dragged (they are always fixed children of a group) so I did some testing by modifying the code in AllowDragging. By doing this, it is possible to have a node selected (so CanDragging returns true), but then have AllowDragging return false. This leads to an exception (System.IndexOutOfRangeException) because it is then possible for m_draggingNodes to be zero. It is odd that even though the check m_draggingNodes.Length fails (length of 0), the exception still happens, which I think would only be the case if m_draggingNodes[0] were called.

jhshen commented 10 years ago

Thanks for your detailed explanation. I will look into this soon.

Shen

jhshen commented 10 years ago

My latest check-in should fix the IndexOutOfRangeException.

Shen

vkashkash commented 10 years ago

Thanks, it has been fixed.