UNSOLVED Undo manager
-
Is there a recommended way to build undo/redo functionality into my own tool, using RoboFont's undo manager? I'd like to be able to undo changes within the Vanilla interface, but also changes to some of my own objects. Is there an extension somewhere that already does this that I can have a look at?
Thanks!
Andy
-
mmm I see the problem is that its edits the blue zones, and when the font info has changed, RF will update tons of views and cells...
I would store it temporarily in
font.lib
while editing (as you want to jump to different glyphs and see the same values). When not editing (dragging fe) write it back in thefont.info
.
-
It's in my BlueZoneEditor tool...
There's a delay when reading/writing to the
font.info
so I hold all of the zone data aside, it makes the editing feel smoother and more interactive. It's a little bit overkill but each of the blue zones are their own object, and I'd like for changes to those objects to be undoable.I think I'll take your advice and see if it still feels quick enough to read/write them into the
font.lib
even though there's still a tiny delay when doing this, but that might be better than how I have it now.Thanks for the suggestion!
-
could you provide an example what you want to undo?
I would propose to use the
glyph.lib
as data storage and callglyph.lib.prepareUndo("My Change")
andglyph.lib.performUndo()
when you are done.