提交 5a9efd8a 编写于 作者: J Johannes Rieken

better y-position when clicking light bulb, #11400

上级 d7b8a9c9
......@@ -55,7 +55,15 @@ export class LightBulbWidget implements IOverlayWidget, IDisposable {
this._domNode.className = 'lightbulb-glyph hidden';
this._toDispose.push(dom.addDisposableListener(this._domNode, 'mousedown', (e: MouseEvent) => {
e.preventDefault();
this._onClick.fire({ x: e.clientX, y: e.clientY });
// a bit of extra work to make sure the menu
// doesn't cover the line-text
const {top, height} = dom.getDomNodePagePosition(this._domNode);
const {lineHeight} = this._editor.getConfiguration();
this._onClick.fire({
x: e.clientX,
y: top + height + Math.floor(lineHeight / 3)
});
}));
}
return this._domNode;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册