diff options
author | shitcreek <luulac85@gmail.com> | 2019-09-27 05:28:37 +0300 |
---|---|---|
committer | shitcreek <luulac85@gmail.com> | 2019-09-27 05:28:37 +0300 |
commit | 1ef4d927c815c1a55dfb7d9a2ce35908fa78bbc8 (patch) | |
tree | b6c92a4e0b7e85dc07e04988209dd528afa02647 /_tools | |
parent | b975aa1bc6a4c3d10936a5e5d22897b1187d5e41 (diff) |
fix bitmap converter - got rid of extra column produced
Diffstat (limited to '_tools')
-rw-r--r-- | _tools/u8glib/converter.html | 1 | ||||
-rw-r--r-- | _tools/u8glib/converter.js | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/_tools/u8glib/converter.html b/_tools/u8glib/converter.html index d461b77f..e593c761 100644 --- a/_tools/u8glib/converter.html +++ b/_tools/u8glib/converter.html @@ -20,7 +20,6 @@ category: [ tools ] <div class="options"> <label id="liton-lbl" title="Use light pixels from the source image."> <input type="checkbox" id="lit-on" /> Light</label> <label title="Invert the output bits."> <input type="checkbox" id="inv-on" /> Invert</label> - <label title="Output in Binary (not Hex) format."> <input type="checkbox" id="bin-on" checked="checked" /> Binary</label> <label title="Include an ASCII representation."> <input type="checkbox" id="ascii-on" /> ASCII Art</label> <label title="Use UTF8 blocks instead of ASCII."> <input type="checkbox" id="skinny-on" /> Narrow</label> diff --git a/_tools/u8glib/converter.js b/_tools/u8glib/converter.js index a6a7c6eb..ebc6b764 100644 --- a/_tools/u8glib/converter.js +++ b/_tools/u8glib/converter.js @@ -328,7 +328,9 @@ var bitmap_converter = function() { for (var y = 0; y < ih; y++) { // loop Y var bitline = ' // '; cpp += ' '; - for (var x = 0; x <= iw; x += 8) { // loop X + // for (var x = 0; x <= iw; x += 8) { // loop X + for (var x = 0; x + 8 <= iw; x += 8) { // loop X + var byte = 0; for (var b = 0; b < 8; b++) { // loop 8 bits var xx = x + b, i = y * iw + xx, @@ -339,7 +341,7 @@ var bitmap_converter = function() { : bb ? '#' : '.'; } cpp += tobase(byte) - + (x == lastx && y == ih - 1 && !extra_x ? ' ' : ','); + + (x + 8 == lastx && y == ih - 1 && !extra_x ? ' ' : ','); } // Fill out stat lines for (var x = extra_x; x--;) cpp += zero + (x || y < ih - 1 ? ',' : ' '); |