提交 159f91c5 编写于 作者: R rebornix

update comments and remove unnecessary dirty check

上级 ad559ec9
......@@ -463,7 +463,7 @@ class MouseDownOperation extends Disposable {
this._mouseDragThenMoveEventHandler.handler,
() => {
if (this._mouseState.lastMouseDownEvent !== 'drag') {
// the last event is mouse down which happens 16ms ago.
// there is no dragging so we need to update the cursor position like a simple mouse down+up.
this._dispatchMouse(position, e.shiftKey);
} else {
this._viewController.emitMouseDrop({
......
......@@ -129,8 +129,6 @@ export class ViewController implements IViewController {
} else {
this.createCursor('mouse', data.position, false);
}
// last cursor range select drag
}
}
} else {
......
......@@ -23,7 +23,6 @@ export class DragTargetHintWidget extends Widget implements editorBrowser.IConte
private _typicalHalfwidthCharacterWidth: number;
private readonly _domNode: FastDomNode;
private _isVisible: boolean = false;
private _isDirty: boolean = false;
protected get isVisible(): boolean {
return this._isVisible;
......@@ -33,27 +32,6 @@ export class DragTargetHintWidget extends Widget implements editorBrowser.IConte
this._isVisible = value;
}
protected set cursorStyle(value: TextEditorCursorStyle) {
if (this._cursorStyle !== value) {
this._cursorStyle = value;
this._isDirty = true;
}
}
protected set lineHeight(value: number) {
if (this._lineHeight !== value) {
this._lineHeight = value;
this._isDirty = true;
}
}
protected set typicalHalfwidthCharacterWidth(value: TextEditorCursorStyle) {
if (this._typicalHalfwidthCharacterWidth !== value) {
this._typicalHalfwidthCharacterWidth = value;
this._isDirty = true;
}
}
constructor(editor: editorBrowser.ICodeEditor) {
super();
this._editor = editor;
......@@ -69,15 +47,15 @@ export class DragTargetHintWidget extends Widget implements editorBrowser.IConte
this._domNode.setVisibility('hidden');
this._editor.addContentWidget(this);
this.cursorStyle = this._editor.getConfiguration().viewInfo.cursorStyle;
this.lineHeight = this._editor.getConfiguration().lineHeight;
this.typicalHalfwidthCharacterWidth = this._editor.getConfiguration().fontInfo.typicalHalfwidthCharacterWidth;
this._cursorStyle = this._editor.getConfiguration().viewInfo.cursorStyle;
this._lineHeight = this._editor.getConfiguration().lineHeight;
this._typicalHalfwidthCharacterWidth = this._editor.getConfiguration().fontInfo.typicalHalfwidthCharacterWidth;
this._register(this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => {
if (e.fontInfo || e.viewInfo || e.lineHeight) {
this.typicalHalfwidthCharacterWidth = this._editor.getConfiguration().fontInfo.typicalHalfwidthCharacterWidth;
this.lineHeight = this._editor.getConfiguration().lineHeight;
this.cursorStyle = this._editor.getConfiguration().viewInfo.cursorStyle;
this._typicalHalfwidthCharacterWidth = this._editor.getConfiguration().fontInfo.typicalHalfwidthCharacterWidth;
this._lineHeight = this._editor.getConfiguration().lineHeight;
this._cursorStyle = this._editor.getConfiguration().viewInfo.cursorStyle;
}
}));
......@@ -136,7 +114,7 @@ export class DragTargetHintWidget extends Widget implements editorBrowser.IConte
}
private renderCursor() {
if (!this.isVisible || !this._isDirty) {
if (!this.isVisible) {
return;
}
......@@ -153,7 +131,5 @@ export class DragTargetHintWidget extends Widget implements editorBrowser.IConte
} else {
this._domNode.setClassName('cursor secondary');
}
this._isDirty = false;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册