inline if didn't work. Added intermediate register_event function in transition library
This commit is contained in:
@@ -35,7 +35,7 @@ increase it if you need more temporary selection buffers
|
||||
]]
|
||||
local dt = require "darktable"
|
||||
local du = require "lib/dtutils"
|
||||
|
||||
require "lib/darktable_transition"
|
||||
du.check_min_api_version("2.0.0", "save_selection")
|
||||
local CURR_API_STRING = dt.configuration.api_version_string
|
||||
|
||||
@@ -43,16 +43,16 @@ local buffer_count = 5
|
||||
|
||||
for i=1,buffer_count do
|
||||
local saved_selection
|
||||
dt.register_event(CURR_API_STRING >= "6.2.1" and "save_selection", "shortcut" or "shortcut" ,function()
|
||||
dt.register_event("save_selection", "shortcut", function()
|
||||
saved_selection = dt.gui.selection()
|
||||
end,"save to buffer "..i)
|
||||
dt.register_event(CURR_API_STRING >= "6.2.1" and "save_selection1", "shortcut" or "shortcut" ,function()
|
||||
dt.register_event("save_selection1", "shortcut", function()
|
||||
dt.gui.selection(saved_selection)
|
||||
end,"restore from buffer "..i)
|
||||
end
|
||||
|
||||
local bounce_buffer = {}
|
||||
dt.register_event(CURR_API_STRING >= "6.2.1" and "save_selection2", "shortcut" or "shortcut" ,function()
|
||||
dt.register_event("save_selection2", "shortcut", function()
|
||||
bounce_buffer = dt.gui.selection(bounce_buffer)
|
||||
end,"switch selection with temporary buffer")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user