Fix inverted text display. Fix #883 (#968)

* Fix inverted text display. Fix #883

* Add a comment explaining setBackgroundColor override
This commit is contained in:
Igor Stroganov 2016-11-10 03:11:51 +03:00 committed by Guillermo Rauch
parent 4643099911
commit 48dd4b5c1f
2 changed files with 10 additions and 1 deletions

View file

@ -37,7 +37,11 @@ export default class Term extends Component {
prefs.set('cursor-color', this.validateColor(props.cursorColor, 'rgba(255,255,255,0.5)'));
prefs.set('enable-clipboard-notice', false);
prefs.set('foreground-color', props.foregroundColor);
prefs.set('background-color', 'transparent');
// hterm.ScrollPort.prototype.setBackgroundColor is overriden
// to make hterm's background transparent. we still need to set
// background-color for proper text rendering
prefs.set('background-color', props.backgroundColor);
prefs.set('color-palette-overrides', getColorList(props.colors));
prefs.set('user-css', this.getStylesheet(props.customCSS));
prefs.set('scrollbar-visible', false);

View file

@ -207,6 +207,11 @@ hterm.Terminal.prototype.onMouse_ = function (e) {
return oldOnMouse.call(this, e);
};
// make background transparent to avoid transparency issues
hterm.ScrollPort.prototype.setBackgroundColor = function () {
this.screen_.style.backgroundColor = 'transparent';
};
// fixes a bug in hterm, where the shorthand hex
// is not properly converted to rgb
lib.colors.hexToRGB = function (arg) {