"docs/git@developer.sourcefind.cn:zhaoyu6/sglang.git" did not exist on "f0e15dc6ab6766a8fcdeedb5432b92a18e14979f"
Commit 1a322ca6 authored by pythongosssss's avatar pythongosssss
Browse files

Fix scaled position

parent 32fd39b4
......@@ -111,9 +111,13 @@ app.registerExtension({
// Focus the filter box when opening
filter.focus();
// If the top is off screen then shift the element
if (parseInt(this.root.style.top) < 0) {
this.root.style.top = 0;
const rect = this.root.getBoundingClientRect();
// If the top is off screen then shift the element with scaling applied
if (rect.top < 0) {
const scale = 1 - this.root.getBoundingClientRect().height / this.root.clientHeight;
const shift = (this.root.clientHeight * scale) / 2;
this.root.style.top = -shift + "px";
}
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment