Adds image size to comment in code output

Closes issue #13
This commit is contained in:
javl
2018-01-14 17:35:30 +01:00
parent 24e85b89b4
commit 43820ab394
+4 -4
View File
@@ -810,7 +810,7 @@
code = "\t" + code.split("\n").join("\n\t") + "\n"; code = "\t" + code.split("\n").join("\n\t") + "\n";
var variableCount = images.length() > 1 ? count++ : ""; var variableCount = images.length() > 1 ? count++ : "";
var comment = " // '" + image.glyph + "'\n"; var comment = " // '" + image.glyph + "', "+image.canvas.width+"x"+image.canvas.height+"px\n";
code = comment + "const unsigned char " code = comment + "const unsigned char "
+ getIdentifier() + getIdentifier()
@@ -827,7 +827,7 @@
images.each(function(image) { images.each(function(image) {
code = imageToString(settings['drawMode'], image); code = imageToString(settings['drawMode'], image);
code = "\t" + code.split("\n").join("\n\t") + "\n"; code = "\t" + code.split("\n").join("\n\t") + "\n";
comment = "\t// '" + image.glyph + "'\n"; comment = "\t// '" + image.glyph + ", " + image.canvas.width+"x"+image.canvas.height+"px\n";
output_string += comment + code; output_string += comment + code;
}); });
@@ -845,7 +845,7 @@
images.each(function(image) { images.each(function(image) {
code = imageToString(settings['drawMode'], image); code = imageToString(settings['drawMode'], image);
code = "\t" + code.split("\n").join("\n\t") + "\n"; code = "\t" + code.split("\n").join("\n\t") + "\n";
comment = "\t// '" + image.glyph + "'\n"; comment = "\t// '" + image.glyph + ", " + image.canvas.width+"x"+image.canvas.height+"px\n";
output_string += comment + code; output_string += comment + code;
if(image.glyph.length == 1) useGlyphs++; if(image.glyph.length == 1) useGlyphs++;
}); });
@@ -899,7 +899,7 @@
default: { default: {
images.each(function(image) { images.each(function(image) {
code = imageToString(settings['drawMode'], image); code = imageToString(settings['drawMode'], image);
var comment = image.glyph ? (" // '" + image.glyph + "'\n") : ""; var comment = image.glyph ? (" // '" + image.glyph + "', " + image.canvas.width+"x"+image.canvas.height+"px\n") : "";
if(image.img != images.first().img) comment = "\n" + comment; if(image.img != images.first().img) comment = "\n" + comment;
code = comment + code; code = comment + code;
output_string += code; output_string += code;