fix image rendering.

This commit is contained in:
Christopher Jeffrey 2015-02-09 00:19:35 -08:00
parent cce38f9f21
commit 9e234c3901
2 changed files with 11 additions and 3 deletions

View File

@ -6583,7 +6583,7 @@ Image.w3mdisplay = '/usr/lib/w3m/w3mimgdisplay';
Image.prototype.render = function() {
var ret = this._render();
if (!ret) return;
this.setImage(this.options.file);
this.setImage(this.img);
return ret;
};

View File

@ -6,16 +6,24 @@ screen = blessed.screen({
smartCSR: true
});
blessed.image.w3mdisplay = '/does/not/exist';
var file = process.argv[2] || __dirname + '/test-image.png';
var img = blessed.image({
parent: screen,
left: 'center',
top: 'center',
width: 'shrink',
height: 'shrink',
bg: 'green',
file: process.argv[2] || __dirname + '/test-image.png'
bg: 'green'
});
setTimeout(function() {
img.setImage(file);
screen.render();
}, 1000);
img.focus();
screen.key('i', function() {