Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groups of groups picking issues #17

Closed
vkashkash opened this issue Sep 3, 2014 · 6 comments
Closed

Groups of groups picking issues #17

vkashkash opened this issue Sep 3, 2014 · 6 comments

Comments

@vkashkash
Copy link

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
Copy link
Contributor

jhshen commented Sep 3, 2014

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

Ron2 added a commit that referenced this issue Sep 4, 2014
1. Fixed nested circuit group manually resizing problem. #17
2. Do not draw the separate line between title and content when the
element has no content. #19
(Thanks to Shen for the fixes.)
@jhshen
Copy link
Contributor

jhshen commented Sep 4, 2014

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

Shen

@vkashkash
Copy link
Author

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
Copy link
Contributor

jhshen commented Sep 5, 2014

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

Shen

@jhshen
Copy link
Contributor

jhshen commented Sep 5, 2014

My latest check-in should fix the IndexOutOfRangeException.

Shen

@vkashkash
Copy link
Author

Thanks, it has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants