@@ -270,7 +270,8 @@ M.translate = translate
270
270
-- Changeref (generic patch, lw_>0: RT, lw_<0: TR)
271
271
272
272
function M.changeref (elm, m, lw_) -- unchecked
273
- local lw = lw_ or 1
273
+ local sdir, edir in m
274
+ local lw = (lw_ or 1)*sdir -- for trackone, sdir is not placed into lw
274
275
local dx, dy, ds, dphi, dpsi in elm
275
276
local dthe = elm.dtheta
276
277
local trn = abs(dx )+abs(dy )+abs(ds ) >= minlen
@@ -285,21 +286,21 @@ function M.changeref (elm, m, lw_) --
285
286
286
287
-- rotate
287
288
if rot and lw > 0 then
288
- yrotation( dthe, m, 1 )
289
- xrotation(-dphi, m, 1 )
290
- srotation( dpsi, m, 1 )
289
+ yrotation( dthe, m, edir )
290
+ xrotation(-dphi, m, edir )
291
+ srotation( dpsi, m, edir )
291
292
end
292
293
293
294
-- translate
294
295
if trn then
295
- translate({dx=dx, dy=dy, ds=ds}, m, lw)
296
+ translate({dx=dx, dy=dy, ds=ds}, m, 1) -- translate does everything
296
297
end
297
298
298
299
-- rotate
299
300
if rot and lw < 0 then
300
- srotation( dpsi, m, -1 )
301
- xrotation(-dphi, m, -1 )
302
- yrotation( dthe, m, -1 )
301
+ srotation( dpsi, m, -edir )
302
+ xrotation(-dphi, m, -edir )
303
+ yrotation( dthe, m, -edir )
303
304
end
304
305
305
306
m.atdebug(elm, m, lw_, 'changeref:1')
0 commit comments