Wednesday, July 22, 2009

Preparing for update release

NaroCAD using the 1.0 codebase have huge jumps over adding new shapes, UI improvements, fixes, options dialog to hide toolbars. So it is better and greater.

Copy-Paste have some cases when it did not work properly and those problems are addressed.

Do someone see the problem here:
foreach(var childInterpreter in source.Interpreters)
{
AttributeData data = new AttributeData(childInterpreter.Key);
childInterpreter.Value.Serialize(data);

destionation.Interpreters[childInterpreter.Key] = AttributeInterpreterFactory.GetInterpreter(
childInterpreter.Key,
destionation);
destionation.Interpreters[childInterpreter.Key].Deserialize(data);
}

This code should iterate over all node's source data, serialize it, and deserialize in Paste's destination node.

The problem is that some interpreters are writing other interpreters like: Function modifies Shape interpreter, visibility changes again Shape interpreter, etc.
So the line:
destionation.Interpreters[childInterpreter.Key] = AttributeInterpreterFactory.GetInterpreter(
childInterpreter.Key,
destionation);
was replacing other already built interpreters. The solution is to create the interpreters before and deseralize them after.

This means that a lot of small touches are there and makes things to run smooth.

No comments: