What I meant in my previous comment is that all 3 of these if conditions are essentially the same. What about a function like:

```
function f(stroke, hasEdge) {
  var mod2 = stroke.length % 2;
  if (hasEdge && mod2 !== 0 || !hasEdge && mod2 === 0) {
    stroke.push(0);
  }
}
```
Then the if statements become more condensed, readable, and DRYer. (obviously `f` is a horrible name, but I don't know what to call it)
```
if (f(t)) { ... }
if (f(r)) { ... }
if (f(b)) { ... }
if (f(l)) { ... }
```