diff options
author | orwell96 <orwell@bleipb.de> | 2018-12-19 22:52:05 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-12-19 22:52:05 +0100 |
commit | b6c5604dcf53f43a64243feaa654a7b422d1bfa9 (patch) | |
tree | 6a20e89da630100392d6894ec9ce2390941083fe | |
parent | 09d23029095ea911bc079dae295286fec5e81635 (diff) | |
download | advtrains_netmapper-b6c5604dcf53f43a64243feaa654a7b422d1bfa9.tar.gz advtrains_netmapper-b6c5604dcf53f43a64243feaa654a7b422d1bfa9.tar.bz2 advtrains_netmapper-b6c5604dcf53f43a64243feaa654a7b422d1bfa9.zip |
Fix tag duplication bug when track begins/ends beyond bounds
-rw-r--r-- | main.lua | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -233,7 +233,11 @@ end local function polyline_write(pl) local p1y = cfactor(pl[1].y) - local str = {pl_header(p1y)} + local str = {} + + if p1y <= 1 and p1y >= 0 then + table.insert(str, pl_header(p1y)) + end local i local e @@ -260,9 +264,9 @@ local function polyline_write(pl) end lastcf = cf end - - table.insert(str, '" />\n') - + if lastcf <= 1 and lastcf >= 0 then + table.insert(str, '" />\n') + end svgfile:write(table.concat(str)) plcnt = plcnt + 1 end |