diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-03-22 11:36:42 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-03-22 11:36:42 -0400 |
| commit | 6a30feead73dbee2d664b0099efcdc5106096c55 (patch) | |
| tree | 25685907394a49d2e22637f7e5c649904e09c4dc /js/draw.js | |
| parent | 858587af95cfd02341cee1ec1f63c560f6944145 (diff) | |
| parent | b55c277f18a56cb6c6f85df968111f230e828b07 (diff) | |
Merge branch 'master' of lmno:ascii
Diffstat (limited to 'js/draw.js')
| -rw-r--r-- | js/draw.js | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -43,18 +43,19 @@ var draw = (function(){ } function stamp (canvas, brush, x, y, erasing) { - hh = brush.w/2|0 + var hh = brush.w/2|0 brush.forEach(function(lex, s, t){ s = round( s + x-hh ) t = round( t + y-hh ) - if (lex.opacity > 0 && s >= 0 && s < canvas.w && t >= 0 && t < canvas.h) { + if (s >= 0 && s < canvas.w && t >= 0 && t < canvas.h) { + if (lex.opacity === 0 && lex.char === ' ') return; var aa = canvas.aa[t][s] undo.save_lex(s, t, aa) if (erasing) { aa.erase(lex) } else { - aa.paint(lex) + aa.stamp(lex, brush) } } }) |
