Skip to content

Commit

Permalink
Add onHeaderReleased callback
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Feb 17, 2021
1 parent 45d5645 commit a5f8090
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/zui/Nodes.hx
Expand Up @@ -35,6 +35,7 @@ class Nodes {

public static var excludeRemove: Array<String> = []; // No removal for listed node types
public static var onLinkDrag: TNodeLink->Bool->Void = null;
public static var onHeaderReleased: TNode->Void = null;
public static var onSocketReleased: TNodeSocket->Void = null;
public static var onNodeRemove: TNode->Void = null;
public static var onCanvasControl: Void->CanvasControl = null; // Pan, zoom
Expand Down Expand Up @@ -275,6 +276,9 @@ class Nodes {
else if (ui.inputReleased && !ui.isShiftDown && !dragged) {
// No drag performed, select single node
nodesSelected = [node];
if (onHeaderReleased != null) {
onHeaderReleased(node);
}
}
}
if (ui.inputStarted && ui.getInputInRect(wx + NODE_X(node) - LINE_H() / 2, wy + NODE_Y(node) - LINE_H() / 2, NODE_W() + LINE_H(), nodeh + LINE_H())) {
Expand Down

0 comments on commit a5f8090

Please sign in to comment.