I finally added repr listener to the node editor, which means it now updates its nodes when an object is modified outside of its control (by undo, in XML editor, in another view etc.) This fixes 857997, 852973, 865627, and re-fixes 848355 properly (previous hack in document_undo is removed).
"Works for me" but I'd appreciate if it is tested really thoroughly, as the code is still somewhat flakey. E.g. instead of the closed bug I'm now submitting two other bugs related to the new code which I still need to fix. Any insights are appreciated.
Some issues:
- When to regenerate the nodepath? Not always when a repr is changed, because the majority of such changes are from the node editor itself. One approach: compare the actual repr with a "fake" repr temporarily created from the current nodepath; if different, recreate nodepath. Another approach: When updating repr from within node editor, set up the local_change flag. The listener checks this flag and if it's set, does not recreate nodepath (but zeroes the flag). Right now my code uses both these approaches, the first for the nodepath and the other for knot_holder (the structure used to edit ellipses, spirals etc). Does anyone have an opinion on which approach is more preferable?
- Preserving selection is a hack: before regenerating nodepath, I save the list of the numbers of selected nodes, and then re-select them in the new nodepath. This does not always work (see bug 867525). Can anyone propose a better idea?
- Objects within groups: they can be transformed via their group, without their repr being changed at all (see bug 867521). What to do with them?
_________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2f...
participants (1)
-
bulia byak