Skip to content

Support opaque selections in DOM renderer #3839

Merged
Tyriar merged 2 commits intoxtermjs:masterfrom
Tyriar:3838
May 27, 2022
Merged

Support opaque selections in DOM renderer #3839
Tyriar merged 2 commits intoxtermjs:masterfrom
Tyriar:3838

Conversation

@Tyriar
Copy link
Copy Markdown
Member

@Tyriar Tyriar commented May 27, 2022

Brings the DOM renderer closer to the webgl renderer which draws the text
on top of the selection. This is done by leveraging the override system
similar to in webgl and as well as forcing the element above the selection.
This also improves contrast color caching for the DOM renderer.

This should result in a slight performance hit but only when a selection
is being made. The improved contrast seems worth it.

Fixes #3838


term.setOption('rendererType', 'dom');
term.setOption('minimumContrastRatio', 5);
term.setOption('theme', {
    selection: '#ffffff',
    selectionForeground: '#000000'
});

Before:

image

After:

image


Using this to show minimum contrast ratio is working:

term.setOption('rendererType', 'dom');
term.setOption('minimumContrastRatio', 5);
term.setOption('theme', {
    selection: '#ff0000',
    foreground: '#ff1111'
});

image

Tyriar added 2 commits May 27, 2022 10:38
Brings the DOM renderer closer to the webgl renderer which draws the text
on top of the selection. This is done by leveraging the override system
similar to in webgl and as well as forcing the element above the selection.
This also improves contrast color caching for the DOM renderer.

This should result in a slight performance hit but only when a selection
is being made. The improved contrast seems worth it.

Fixes xtermjs#3838
@Tyriar Tyriar added this to the 4.19.0 milestone May 27, 2022
@Tyriar Tyriar self-assigned this May 27, 2022
@Tyriar Tyriar enabled auto-merge May 27, 2022 17:54
@Tyriar Tyriar disabled auto-merge May 27, 2022 17:58
@Tyriar Tyriar merged commit 1980f67 into xtermjs:master May 27, 2022
@Tyriar Tyriar deleted the 3838 branch May 27, 2022 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected selectionForeground results on DOM renderer

1 participant