Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MarlinFirmware/MarlinDocumentation.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/_tools
diff options
context:
space:
mode:
authorshitcreek <luulac85@gmail.com>2019-09-27 05:28:37 +0300
committershitcreek <luulac85@gmail.com>2019-09-27 05:28:37 +0300
commit1ef4d927c815c1a55dfb7d9a2ce35908fa78bbc8 (patch)
treeb6c92a4e0b7e85dc07e04988209dd528afa02647 /_tools
parentb975aa1bc6a4c3d10936a5e5d22897b1187d5e41 (diff)
fix bitmap converter - got rid of extra column produced
Diffstat (limited to '_tools')
-rw-r--r--_tools/u8glib/converter.html1
-rw-r--r--_tools/u8glib/converter.js6
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.">&nbsp;&nbsp;<input type="checkbox" id="lit-on" />&nbsp;Light</label>
<label title="Invert the output bits.">&nbsp;&nbsp;<input type="checkbox" id="inv-on" />&nbsp;Invert</label>
- &nbsp;&nbsp;&nbsp;
<label title="Output in Binary (not Hex) format.">&nbsp;&nbsp;<input type="checkbox" id="bin-on" checked="checked" />&nbsp;Binary</label>
<label title="Include an ASCII representation.">&nbsp;&nbsp;<input type="checkbox" id="ascii-on" />&nbsp;ASCII Art</label>
<label title="Use UTF8 blocks instead of ASCII.">&nbsp;&nbsp;<input type="checkbox" id="skinny-on" />&nbsp;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 ? ',' : ' ');