Skip to content

Commit

Permalink
use onDidLayoutContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerLeonhardt committed Jan 17, 2025
1 parent 9d59d1c commit 0daf772
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/vs/platform/quickinput/browser/quickInputController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -938,15 +938,18 @@ class QuickInputDragAndDropController extends Disposable {
}

private _registerLayoutListener() {
this._layoutService.onDidLayoutActiveContainer((e) => {
this._layoutService.onDidLayoutContainer((e) => {
if (e.container !== this._container) {
return;
}
const state = this.dndViewState.get();
const dragAreaRect = this._quickInputContainer.getBoundingClientRect();
if (state?.top && state?.left) {
const a = Math.round(state.left * 1e2) / 1e2;
const b = e.width;
const b = e.dimension.width;
const c = dragAreaRect.width;
const d = a * b - c / 2;
this._layout(state.top * e.height, d);
this._layout(state.top * e.dimension.height, d);
}
});
}
Expand Down

0 comments on commit 0daf772

Please sign in to comment.