handle animating screenshots. ansi-viewer.
This commit is contained in:
parent
5f1d320112
commit
43c39b525f
|
@ -25,6 +25,16 @@ var max = Object.keys(map).reduce(function(out, text) {
|
||||||
return Math.max(out, text.length);
|
return Math.max(out, text.length);
|
||||||
}, 0) + 6;
|
}, 0) + 6;
|
||||||
|
|
||||||
|
// Animating ANSI art doesn't work for screenshots.
|
||||||
|
var ANIMATING = [
|
||||||
|
'bbs/void3',
|
||||||
|
'holiday/xmasfwks',
|
||||||
|
'unsorted/diver',
|
||||||
|
'unsorted/mash-chp',
|
||||||
|
'unsorted/ryans47',
|
||||||
|
'unsorted/xmasfwks'
|
||||||
|
];
|
||||||
|
|
||||||
var screen = blessed.screen({
|
var screen = blessed.screen({
|
||||||
smartCSR: true,
|
smartCSR: true,
|
||||||
dockBorders: true
|
dockBorders: true
|
||||||
|
@ -190,10 +200,14 @@ list.on('select', function(el, selected) {
|
||||||
screen.render();
|
screen.render();
|
||||||
|
|
||||||
if (process.argv[2] === '--debug' || process.argv[2] === '--save') {
|
if (process.argv[2] === '--debug' || process.argv[2] === '--save') {
|
||||||
//var sgr = blessed.element.prototype.screenshot.call(art,
|
// Animating art hangs terminal during screenshot as of right now.
|
||||||
// 0 - art.ileft, art.width - art.iright,
|
if (~ANIMATING.indexOf(name)) {
|
||||||
// 0 - art.itop, art.height - art.ibottom);
|
var sgr = blessed.element.prototype.screenshot.call(art,
|
||||||
|
0 - art.ileft, art.width - art.iright,
|
||||||
|
0 - art.itop, art.height - art.ibottom);
|
||||||
|
} else {
|
||||||
var sgr = art.screenshot();
|
var sgr = art.screenshot();
|
||||||
|
}
|
||||||
fs.writeFileSync(__dirname + '/' + filename + '.sgr', sgr);
|
fs.writeFileSync(__dirname + '/' + filename + '.sgr', sgr);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue