Add TermScreen#backgroundImage

pull/1/head
cpsdqs 7 years ago
parent f28fc5094c
commit 3e7a216450
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 13
      js/term/screen.js

@ -305,6 +305,19 @@ module.exports = class TermScreen extends EventEmitter {
this._scheduledSizeUpdate = setTimeout(() => this.updateSize(), 1) this._scheduledSizeUpdate = setTimeout(() => this.updateSize(), 1)
} }
get backgroundImage () {
return this.canvas.style.backgroundImage
}
set backgroundImage (value) {
this.canvas.style.backgroundImage = value ? `url(${value})` : ''
if (this.renderer.backgroundImage !== !!value) {
this.renderer.backgroundImage = !!value
this.renderer.resetDrawn()
this.scheduleDraw('background-image')
}
}
/** /**
* Returns a CSS font string with this TermScreen's font settings and the * Returns a CSS font string with this TermScreen's font settings and the
* font modifiers. * font modifiers.

Loading…
Cancel
Save