* Clears highlight and mouse-over information from nodes that should not have it. * * Intended to be called when the pointer moves away from a node. * @param node The node that the mouse is now over * @param e MouseEvent that is triggering this
(node: LGraphNode | null, e: CanvasPointerEvent)
| 1914 | * @param e MouseEvent that is triggering this |
| 1915 | */ |
| 1916 | updateMouseOverNodes(node: LGraphNode | null, e: CanvasPointerEvent): void { |
| 1917 | if (!this.graph) throw new NullGraphError() |
| 1918 | |
| 1919 | const { pointer } = this |
| 1920 | const nodes = this.graph._nodes |
| 1921 | for (const otherNode of nodes) { |
| 1922 | if (otherNode.mouseOver && node != otherNode) { |
| 1923 | // mouse leave |
| 1924 | if (!pointer.eDown) pointer.resizeDirection = undefined |
| 1925 | otherNode.mouseOver = undefined |
| 1926 | this._highlight_input = undefined |
| 1927 | this._highlight_pos = undefined |
| 1928 | this.linkConnector.overWidget = undefined |
| 1929 | |
| 1930 | // Hover transitions |
| 1931 | // TODO: Implement single lerp ease factor for current progress on hover in/out. |
| 1932 | // In drawNode, multiply by ease factor and differential value (e.g. bg alpha +0.5). |
| 1933 | otherNode.lostFocusAt = LiteGraph.getTime() |
| 1934 | |
| 1935 | this.node_over?.onMouseLeave?.(e) |
| 1936 | this.node_over = undefined |
| 1937 | this.dirty_canvas = true |
| 1938 | } |
| 1939 | } |
| 1940 | } |
| 1941 | |
| 1942 | processMouseDown(e: PointerEvent): void { |
| 1943 | if (this.dragZoomEnabled && e.ctrlKey && e.shiftKey && !e.altKey && e.buttons) { |
no test coverage detected