Change cursor shape to grab on dragging

This commit is contained in:
huchenlei
2024-09-27 10:26:37 +09:00
committed by Chenlei Hu
parent 7c11409881
commit 0652de8e66
2 changed files with 16 additions and 2 deletions

View File

@@ -56,6 +56,19 @@ export class LGraphCanvas {
black: { color: "#222", bgcolor: "#000", groupcolor: "#444" }
};
public canvas: HTMLCanvasElement;
private _dragging_canvas: boolean = false;
get dragging_canvas(): boolean {
return this._dragging_canvas;
}
set dragging_canvas(value: boolean) {
this._dragging_canvas = value;
if (this.canvas) {
this.canvas.style.cursor = value ? "grab" : "default";
}
}
constructor(canvas, graph, options) {
this.options = options = options || {};
@@ -1106,8 +1119,6 @@ export class LGraphCanvas {
this.connecting_links = null;
this.highlighted_links = {};
this.dragging_canvas = false;
this.dirty_canvas = true;
this.dirty_bgcanvas = true;
this.dirty_area = null;

View File

@@ -164,6 +164,9 @@ export class LiteGraphGlobal {
// Whether to highlight the bounding box of selected groups
highlight_selected_group = false
LGraphGroup: any;
ContextMenu: any;
availableCanvasOptions: any;
constructor() {
//timer that works everywhere