Monday, May 18, 2009

Smarter zoom and small fixes

Zooming an area works again right now. It was based on a new input, which gives a rectangle area to the modeler view. This means also that future actions that use a rectangle may get use of it.

Also, I was fixed the case of changing color on a shape may not be applied on Undo if the shape have no color previously. This was because removing attributes was not notified by the Naro framework code. Right now the removal of attributes is notified and will not make this problem to appear again (for any other properties that will disappear on undo to not update the view).

Custom changes: Document have right now an boolean AutoTransact property. Setting it as true, will make the transactions to be much lighter as they will be considered right after the last commit. Based on that, is both advantageous if you are unsure how to use the document. Also a small changed that was done in the last days is that Document.Commit will get a reason string. This will mean that you will see the reasons for most events in your Undo/Redo lists.

If you don't know what is it about: NaroCAD store the entire scene in one document. This document can have undo/redo operations but they are happening when changes are computed between a document.Transact(); ... document.Commit(reason);. The changes between Transact() and Commit() are setup in your Undo/Redo list. Because some persons may forget to call Transact, setting AutoTransact = true; will make your code to not behave wrong cause of this, and also be a lighter as Commit() will compute a tree as a base of differences, that is passed as the part of Transact() which means that Transact will not generate again the same tree.

No comments: