Updated imageToString() to remove the now deprecated orientation parameter

Updated outputString() to deal with the updated imageToString()
This commit is contained in:
Jochen Derwae
2019-11-12 16:41:55 +01:00
parent 10b7cf3a65
commit 0178ece9e3
+5 -6
View File
@@ -926,7 +926,7 @@
}
}
function imageToString(orientation, image){
function imageToString(image){
// extract raw image data
var ctx = image.ctx;
var canvas = image.canvas;
@@ -955,7 +955,7 @@
case "arduino": {
images.each(function(image) {
code = imageToString(settings["drawMode"], image);
code = imageToString(image);
// Trim whitespace from end and remove trailing comma
code = code.replace(/,\s*$/,"");
@@ -964,7 +964,6 @@
var variableCount = images.length() > 1 ? count++ : "";
var comment = "// '" + image.glyph + "', "+image.canvas.width+"x"+image.canvas.height+"px\n";
//uint16_t - unsigned char
code = comment + "const " + getType() + " " +
getIdentifier() +
variableCount +
@@ -979,7 +978,7 @@
case "arduino_single": {
var comment = "";
images.each(function(image) {
code = imageToString(settings["drawMode"], image);
code = imageToString(image);
code = "\t" + code.split("\n").join("\n\t") + "\n";
comment = "\t// '" + image.glyph + ", " + image.canvas.width+"x"+image.canvas.height+"px\n";
output_string += comment + code;
@@ -998,7 +997,7 @@
var comment = "";
var useGlyphs = 0;
images.each(function(image) {
code = imageToString(settings["drawMode"], image);
code = imageToString(image);
code = "\t" + code.split("\n").join("\n\t") + "\n";
comment = "\t// '" + image.glyph + ", " + image.canvas.width+"x"+image.canvas.height+"px\n";
output_string += comment + code;
@@ -1053,7 +1052,7 @@
}
default: { // plain
images.each(function(image) {
code = imageToString(settings["drawMode"], image);
code = imageToString(image);
var comment = image.glyph ? ("// '" + image.glyph + "', " + image.canvas.width+"x"+image.canvas.height+"px\n") : "";
if(image.img != images.first().img) comment = "\n" + comment;
code = comment + code;