mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Try passing offset to editors on layout (#164287)
* Try passing offset to editors on layout When a notebook editor is created, it currently has to force a relayout to determine where the overlay webview should be positioned. We do this with a call to `getBoundingClientRect` However the grid view should already have information about where the editor is positioned. If we can use this, then we can skip the expensive call to `getBoundingClientRect` entirely This change attempts to pass the `top` and `left` offsets to the `EditorGroupView` and eventually down into `NotebookEditorWidget` The PR does not work properly however as the offset that the `EditorGroupView` gets is wrong. I've added some todo comments about where this seems to be happening * Remove todo and update layout over
This commit is contained in:
@@ -417,7 +417,12 @@ export class Dimension implements IDimension {
|
||||
}
|
||||
}
|
||||
|
||||
export function getTopLeftOffset(element: HTMLElement): { left: number; top: number } {
|
||||
export interface IDomPosition {
|
||||
readonly left: number;
|
||||
readonly top: number;
|
||||
}
|
||||
|
||||
export function getTopLeftOffset(element: HTMLElement): IDomPosition {
|
||||
// Adapted from WinJS.Utilities.getPosition
|
||||
// and added borders to the mix
|
||||
|
||||
|
||||
Reference in New Issue
Block a user