-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendering improvements #1038
Rendering improvements #1038
Conversation
State/diffing code is kept in comments as it may be reinstated soon. Fixes xtermjs#1035 Fixes xtermjs#1036 Fixes xtermjs#1032 Fixes xtermjs#1037
Pulls in xtermjs/xterm.js#1038 and xtermjs/xterm.js#1026 Fixes #35662 Fixes #35188 Fixes #35660 Fixes #35649
@@ -107,4 +107,17 @@ export class ColorManager implements IColorManager { | |||
this.colors.ansi[14] = theme.brightCyan || DEFAULT_ANSI_COLORS[14]; | |||
this.colors.ansi[15] = theme.brightWhite || DEFAULT_ANSI_COLORS[15]; | |||
} | |||
|
|||
private _validateColor(color: string, fallback: string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this mean that theme.background can only be a hex color, not rgb(a) - because otherwise it would just use the fallback color?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does for background, validate could be changed to accommodate rgb/rgba/etc. though.
This was needed to be able to do this:
+ const r = parseInt(background.substr(1, 2), 16);
+ const g = parseInt(background.substr(3, 2), 16);
+ const b = parseInt(background.substr(5, 2), 16);
Fixes #1032
Fixes #1031
Fixes #1035
Fixes #1036
Fixes #1032
Fixes #1037
See individual commits for what was actually done. It turns out drawing the entire line like this is fairly fast, typically ranging from 0.5ms to 4ms on my macbook. The boost in stability/accuracy that this change brings is a must for now. It would be good to go back to intelligently diffing before drawing eventually (when we're certain the characters aren't overlapping).