Relands BetaUI (#77)

* PR1

* PR2

* pr3

* Fix

* Revert 3909

* Ignore/fix type errors

* Fix import
This commit is contained in:
Chenlei Hu
2024-07-01 18:07:12 -04:00
committed by GitHub
parent a26802fea6
commit 5f979e844c
37 changed files with 4135 additions and 470 deletions

View File

@@ -58,8 +58,8 @@ function getClipPath(node: LGraphNode, element: HTMLElement): string {
}
const widgetRect = element.getBoundingClientRect();
const clipX = intersection[0] - widgetRect.x / scale + "px";
const clipY = intersection[1] - widgetRect.y / scale + "px";
const clipX = elRect.left + intersection[0] - widgetRect.x / scale + "px";
const clipY = elRect.top + intersection[1] - widgetRect.y / scale + "px";
const clipWidth = intersection[2] + "px";
const clipHeight = intersection[3] + "px";
const path = `polygon(0% 0%, 0% 100%, ${clipX} 100%, ${clipX} ${clipY}, calc(${clipX} + ${clipWidth}) ${clipY}, calc(${clipX} + ${clipWidth}) calc(${clipY} + ${clipHeight}), ${clipX} calc(${clipY} + ${clipHeight}), ${clipX} 100%, 100% 100%, 100% 0%)`;
@@ -246,6 +246,8 @@ LGraphNode.prototype.addDOMWidget = function (
if (!element.parentElement) {
document.body.append(element);
}
element.hidden = true;
element.style.display = "none";
let mouseDownHandler;
if (element.blur) {
@@ -297,8 +299,8 @@ LGraphNode.prototype.addDOMWidget = function (
Object.assign(element.style, {
transformOrigin: "0 0",
transform: scale,
left: `${transform.a + transform.e}px`,
top: `${transform.d + transform.f}px`,
left: `${transform.a + transform.e + elRect.left}px`,
top: `${transform.d + transform.f + elRect.top}px`,
width: `${widgetWidth - margin * 2}px`,
height: `${(widget.computedHeight ?? 50) - margin * 2}px`,
position: "absolute",