mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
Fix non-transparent background in inline edits (#244470)
fixes https://github.com/microsoft/vscode-copilot/issues/14725
This commit is contained in:
committed by
GitHub
parent
54e42906fb
commit
0f66cde67f
@@ -95,8 +95,7 @@ export class InlineEditsWordReplacementView extends Disposable implements IInlin
|
|||||||
const originalLine = Rect.fromPoints(widgetStart, widgetEnd).withHeight(lineHeight).translateX(-scrollLeft);
|
const originalLine = Rect.fromPoints(widgetStart, widgetEnd).withHeight(lineHeight).translateX(-scrollLeft);
|
||||||
const modifiedLine = Rect.fromPointSize(originalLine.getLeftBottom().add(modifiedOffset), new Point(this._edit.text.length * w, originalLine.height));
|
const modifiedLine = Rect.fromPointSize(originalLine.getLeftBottom().add(modifiedOffset), new Point(this._edit.text.length * w, originalLine.height));
|
||||||
|
|
||||||
const background = Rect.hull([originalLine, modifiedLine]);
|
const lowerBackground = modifiedLine.withLeft(originalLine.left);
|
||||||
const lowerBackground = background.intersectVertical(new OffsetRange(originalLine.bottom, Number.MAX_SAFE_INTEGER));
|
|
||||||
|
|
||||||
// debugView(debugLogRects({ lowerBackground }, this._editor.editor.getContainerDomNode()), reader);
|
// debugView(debugLogRects({ lowerBackground }, this._editor.editor.getContainerDomNode()), reader);
|
||||||
|
|
||||||
@@ -118,6 +117,7 @@ export class InlineEditsWordReplacementView extends Disposable implements IInlin
|
|||||||
}
|
}
|
||||||
|
|
||||||
const contentLeft = this._editor.layoutInfoContentLeft.read(reader);
|
const contentLeft = this._editor.layoutInfoContentLeft.read(reader);
|
||||||
|
const borderWidth = 1;
|
||||||
|
|
||||||
const originalBorderColor = getOriginalBorderColor(this._tabAction).map(c => asCssVariable(c)).read(reader);
|
const originalBorderColor = getOriginalBorderColor(this._tabAction).map(c => asCssVariable(c)).read(reader);
|
||||||
const modifiedBorderColor = getModifiedBorderColor(this._tabAction).map(c => asCssVariable(c)).read(reader);
|
const modifiedBorderColor = getModifiedBorderColor(this._tabAction).map(c => asCssVariable(c)).read(reader);
|
||||||
@@ -137,7 +137,7 @@ export class InlineEditsWordReplacementView extends Disposable implements IInlin
|
|||||||
n.div({
|
n.div({
|
||||||
style: {
|
style: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
...rectToProps(reader => layout.read(reader).lowerBackground.withMargin(0, 2, 0, 0)),
|
...rectToProps(reader => layout.read(reader).lowerBackground.withMargin(borderWidth, 2 * borderWidth, borderWidth, 0)),
|
||||||
background: asCssVariable(editorBackground),
|
background: asCssVariable(editorBackground),
|
||||||
//boxShadow: `${asCssVariable(scrollbarShadow)} 0 6px 6px -6px`,
|
//boxShadow: `${asCssVariable(scrollbarShadow)} 0 6px 6px -6px`,
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
@@ -162,7 +162,7 @@ export class InlineEditsWordReplacementView extends Disposable implements IInlin
|
|||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
borderRadius: '4px',
|
borderRadius: '4px',
|
||||||
border: `1px solid ${modifiedBorderColor}`,
|
border: `${borderWidth}px solid ${modifiedBorderColor}`,
|
||||||
|
|
||||||
background: asCssVariable(modifiedChangedTextOverlayColor),
|
background: asCssVariable(modifiedChangedTextOverlayColor),
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@@ -178,7 +178,7 @@ export class InlineEditsWordReplacementView extends Disposable implements IInlin
|
|||||||
...rectToProps(reader => layout.read(reader).originalLine.withMargin(1)),
|
...rectToProps(reader => layout.read(reader).originalLine.withMargin(1)),
|
||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
borderRadius: '4px',
|
borderRadius: '4px',
|
||||||
border: `1px solid ${originalBorderColor}`,
|
border: `${borderWidth}px solid ${originalBorderColor}`,
|
||||||
background: asCssVariable(originalChangedTextOverlayColor),
|
background: asCssVariable(originalChangedTextOverlayColor),
|
||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user