Skip to content

Issue with Alt+MiddleClick (break pin) and AutoSizeComments graph node #28

Description

@fpwong

Problem

Pressing Alt+MiddleClick inside the AutoSizeComment node does not work because it does not recognize the blank space inside the comment.

In NGAInputProcessor::InitEventContex to detect if the cursor is over blank space inside a comment, the plugin checks the index in the widget path. This doesn't work with the AutoSizeComment graph node because it is constructed differently and so node will not be at the same index in the widget path as the default SGraphNodeComment.

Solution

Instead we can check if the widget path contains a SInlineEditableTextBlock with a higher index, which is another way of checking if the cursor is hovering the title bar. This can be done by editing the branch at NGAInputProcessor.cpp:line 224

if (widgetName.Contains("Node") && widgetName.Contains("Comment"))
{
	ctx.IsCursorOnPanelEmptySpace = true;

	// if a previous widget in the path is a SInlineEditableTextBlock then the cursor is over the title bar
	for (int j = i; j < widgetsUnderCursor.Widgets.Num(); j++)
	{
		FString previousWidgetName = widgetsUnderCursor.Widgets[j].Widget->GetTypeAsString();
		if (previousWidgetName == "SInlineEditableTextBlock")
		{
			ctx.IsCursorOnPanelEmptySpace = false;
			break;
		}
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions