ADG Lua 

ADG Lua Commit Details

Date:2013-03-28 16:36:39 (6 years 6 months ago)
Author:Nicola Fontana
Branch:master
Commit:a99f492488da19bf7a18adf09abaaac1ec07e2fb
Parents: decbbe7db360d92be4671fb5a8277e87d22ca735
Message:piston: improved suffix handling

Avoid to pick the greedest suffix (such as "pdf.png" in a.pdf.png) but
take the shortest ending one ("png").
Changes:
Mpiston.lua (1 diff)

File differences

piston.lua
297297
298298
299299
300
300
301301
302302
303303
-- Inject the export method into Adg.Canvas
rawset(Adg.Canvas, 'export', function (canvas, file, format)
-- The not explicitely set, the export format is guessed from the file suffix
if not format then format = file:match('%.(.*)$') end
if not format then format = file:match('%.([^.]+)$') end
local size = canvas:get_size()
size.x = size.x + canvas:get_left_margin() + canvas:get_right_margin()

Archive Download the corresponding diff file

Branches

Tags