Group Derived Objects become transparent upon selection

I have a custom class node object derived from "Group".

When I place it on the diagram all is good.

However, when I select it, the alpha goes up about 30% and never returns.
If I deselect it, and then reselect it, it goes another 30...etc,, eventually the object becomes invisible.

I have traced the problem down to the last 2 lines of the SelectTool.PerformMove() method:
MoveTool tool = new MoveTool(base.Controller, this, node);
tool.ProcessMouseDown(evtArgs);

the MoveTool makes the objects semi-transparent for move purposes...that's cool.
However, for some reason on these derived nodes, when the mouseUP event occurs, the alpha is not restored.

Note also: if I just group 2 objects on the diagram this does not occur. It's only with these derived group objects.

I must not be handling something in the Group class, but can't figure out what.




2 Replies

AM Ajeet M Syncfusion Team January 2, 2009 07:11 AM UTC

Hi Eric,

I am afraid but I was not able to reproduce the issue mentioned by you.

The sample is located in the following location under the documents folder:

------
\Documents\Syncfusion\EssentialStudio\6.4.0.15\Windows\Diagram.Windows\Samples\2.0\Designing Symbols\CustomSymbol\CS
------

I would be glad if you could send us your sample with complete details of how to reproduce the issue. Also, do mention us your installation details ( version number, .NET framework etc).

Thanks and Regards,
Ajeet




ER Eric Robishaw January 12, 2009 10:51 PM UTC

Found the problem:
my derived group class overrode the Clone() method and return a shallow copy using MemberwiseCopy().

When the MoveTool starts to move the object, it first creates a clone of the object, then sets the transparency of the object to 50%. However, because I was returning a shallow copy, the children of my group were each being affected, instead of a copy of the children, and thus, the transparency was getting halfed every time it was selecetd.

Anyhow, if anyone experiences this in the future... make sure you do a full, deep copy, in the Clone() method, or you'll run into problems.


Loader.
Up arrow icon