mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-09 10:42:02 +00:00
minor fix. refactor.
This commit is contained in:
parent
abdd0a8c89
commit
ffb657ba1b
@ -53,19 +53,32 @@ BigText.prototype.loadFont = function(filename) {
|
|||||||
this.ratio.height = data.height;
|
this.ratio.height = data.height;
|
||||||
|
|
||||||
function convertLetter(ch, lines) {
|
function convertLetter(ch, lines) {
|
||||||
|
var line, i;
|
||||||
|
|
||||||
while (lines.length > self.ratio.height) {
|
while (lines.length > self.ratio.height) {
|
||||||
lines.shift();
|
lines.shift();
|
||||||
lines.pop();
|
lines.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
lines = lines.map(function(line) {
|
lines = lines.map(function(line) {
|
||||||
var chs = line.split('');
|
var chs = line.split('');
|
||||||
chs = chs.map(function(ch) {
|
chs = chs.map(function(ch) {
|
||||||
return ch === ' ' ? 0 : 1;
|
return ch === ' ' ? 0 : 1;
|
||||||
});
|
});
|
||||||
while (chs.length < self.ratio.width) chs.push(0);
|
while (chs.length < self.ratio.width) {
|
||||||
|
chs.push(0);
|
||||||
|
}
|
||||||
return chs;
|
return chs;
|
||||||
});
|
});
|
||||||
while (lines.length < self.ratio.height) lines.push([0, 0, 0, 0, 0, 0, 0, 0]);
|
|
||||||
|
while (lines.length < self.ratio.height) {
|
||||||
|
line = [];
|
||||||
|
for (i = 0; i < self.ratio.width; i++) {
|
||||||
|
line.push(0);
|
||||||
|
}
|
||||||
|
lines.push(line);
|
||||||
|
}
|
||||||
|
|
||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user