From: Thomas Bläsius Date: Fri, 8 Nov 2013 10:14:28 +0000 (+0100) Subject: No undo/redo when rendering pagenumbers. This has the (strange) X-Git-Url: https://i11git.iti.kit.edu/anon-gitweb/?a=commitdiff_plain;h=5a67f06a3038b02ec8534db983e7e21edf238d80;p=Misc%2Fipe.git No undo/redo when rendering pagenumbers. This has the (strange) effect that the new layer is no longer displayed immediately after insertion. However, it does not really make sense to put this operation on the undo stack. --- diff --git a/ipelets/pagenumbers/example.ipe b/ipelets/pagenumbers/example.ipe index dcfd7ed..5827045 100644 --- a/ipelets/pagenumbers/example.ipe +++ b/ipelets/pagenumbers/example.ipe @@ -1,7 +1,7 @@ - + @@ -202,13 +202,13 @@ h + + - - @@ -234,7 +234,7 @@ h - + {\bf [page]} The current page is: [page] \begin{itemize} diff --git a/ipelets/pagenumbers/pagenumbers.lua b/ipelets/pagenumbers/pagenumbers.lua index 9c28033..559fd67 100644 --- a/ipelets/pagenumbers/pagenumbers.lua +++ b/ipelets/pagenumbers/pagenumbers.lua @@ -40,12 +40,13 @@ function refresh_pagenumbers(model) local t = { label = "refresh pagenumbers (not undoable)", model = model } t.redo = function (t, doc) - print_on_ever_page(t.model, pagenr_objects) + print_on_every_page(t.model, pagenr_objects) end t.undo = function (t, doc) -- no undo possible.. end - model:register(t) + -- model:register(t) + print_on_every_page(model, pagenr_objects) end end @@ -70,7 +71,7 @@ end ---------------------------------------------------------------------- -- print given pagenumber objects on every page ---------------------- -function print_on_ever_page(model, pagenr_objects) +function print_on_every_page(model, pagenr_objects) local doc = model.doc -- print "copy.." -- first create the clones