TypeRig icon indicating copy to clipboard operation
TypeRig copied to clipboard

[Epic] Undo states and object updates

Open kateliev opened this issue 11 months ago • 0 comments

Reimplement the TR and FL undo. Long overdue...

Guidelines and remarks as discussed with Yury over private chat :

  • also, for many operations you need to undo several objects at once, so you need to call notifyChangesAppliedToObjects(message, [flObject], ), where == True (not always required);
  • .changed() is safe, it is better to call it than not;
  • notifyChangesApplied should not be called more than once for a single action, if you are about to store changes in several objects, you need to call list version of it;
  • flNode is an exception, if you "change" it, it will not automatically "change" contour (to save RAM);
  • if you "change" contour, it should change flShapeData and then flShape, flLayer, etc;
  • for Undo the lowest recommended object is flShapeData;
  • you need to get to the flShape level only if you changed something in the element properties, like pen thickness or transformation. Actual contours live in flShapeData: it can be shared between many flShape objects, that is "element reference";

kateliev avatar Mar 26 '24 09:03 kateliev