Ticket #1019 (closed defect: fixed)
Modifying styles through automation truncates "spacing" field to int
| Reported by: | TheFluff | Owned by: | nielsm |
|---|---|---|---|
| Priority: | low | Milestone: | 2.1.8 |
| Component: | Scripting | Version: | 2.1.7 |
| Severity: | minor | Keywords: | |
| Cc: | mermaid.sea@… | Platform: | All |
| Sub Component: |
Description
script_name = "Style Copy"
script_description = "Duplicates a style."
script_author = "Lexica-chan"
script_version = "1.0"
function do_style_copy(subs)
local style = nil
local stylepos = nil
for i = 1, #subs do
if subs[i].class == "style" then
stylepos = i
style = subs[i]
break
end
end
style.name = style.name .. " (Copy)"
subs[-1 * stylepos] = style
aegisub.set_undo_point(script_name)
end
aegisub.register_macro(script_name, script_description, do_style_copy)
The above code should do nothing to the style, but if the spacing field is noninteger, it gets truncated.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


Attaching a patch that should fix this. I can't commit it myself right now due to working on a branch, and I can't bother switching back :)