Created
May 5, 2012 23:20
-
-
Save torque/2606254 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gui = { | |
xlabel = { class = "label"; label = "x scale factor"; x = 0; y = 0; height = 1; width = 1;}, | |
ylabel = { class = "label"; label = "y scale factor"; x = 0; y = 1; height = 1; width = 1;}, | |
xsclf = { class = "floatedit"; name = "xsclf"; value = 1; x = 1; y = 0; height = 1; width = 1;}, | |
ysclf = { class = "floatedit"; name = "ysclf"; value = 1; x = 1; y = 1; height = 1; width = 1;}, | |
} | |
function drawgui(sub,sel) | |
local b,c = aegisub.dialog.display(gui) | |
scale(sub,sel,c) | |
end | |
function scale(sub,sel,conf) | |
for i,lineindex in ipairs(sel) do | |
local line = sub[lineindex] | |
line.text = line.text:gsub("\\fscx([%d%-%.]+)",function(a) return "\\fscx"..(tonumber(a)*conf.xsclf) end) | |
line.text = line.text:gsub("\\fscy([%d%-%.]+)",function(a) return "\\fscy"..(tonumber(a)*conf.ysclf) end) | |
sub[lineindex] = line | |
end | |
end | |
aegisub.register_macro("Scale Lines","Scale the scales in the selected lines",drawgui) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment