Skip to content

Commit 973c8d7

Browse files
authored
Merge pull request #347 from jgray-19/subelm_fixes
Thick sub-element fix
2 parents f731d3c + 2dd23b2 commit 973c8d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/madl_etrck.mad

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,8 @@ local function tracksub (elm, m, inter, thick, thin, fringe)
445445
else -- backtrack
446446
local at, lw = 1
447447
for i=#elm,1,-1 do
448-
at, lw = elm[i].sat, at - elm[i].sat
448+
local sat = elm[i].sat - elm[i].l/m.el -- Thick element, therefore at is the exit point (el is weighted by sdir)
449+
at, lw = sat, at - sat
449450
if abs(lw) >= minlen then -- body step
450451
inter(elm, m, lw, thick, thin)
451452
end

0 commit comments

Comments
 (0)