Files
UnrealEngineUWP/Engine/Source/Editor/GraphEditor/Private/MaterialNodes/SGraphNodeMaterialComment.cpp
daren cheng 9a9a0cb1f9 Edigrate 16359780.
Don't create transactions except on release when moving nodes.

#jira UE-115317
#rb Francis.Hurteau, Patrick.Boutot
#preflight 60a3ff23733ad00001685c6a

[CL 16373994 by daren cheng in ue5-main branch]
2021-05-18 15:26:27 -04:00

28 lines
1.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "MaterialNodes/SGraphNodeMaterialComment.h"
#include "Materials/MaterialExpressionComment.h"
#include "MaterialGraph/MaterialGraphNode_Comment.h"
void SGraphNodeMaterialComment::Construct(const FArguments& InArgs, class UMaterialGraphNode_Comment* InNode)
{
SGraphNodeComment::Construct(SGraphNodeComment::FArguments(), InNode);
this->CommentNode = InNode;
}
void SGraphNodeMaterialComment::MoveTo(const FVector2D& NewPosition, FNodeSet& NodeFilter, bool bMarkDirty)
{
if( !NodeFilter.Find( SharedThis( this ) ))
{
SGraphNodeComment::MoveTo(NewPosition, NodeFilter, bMarkDirty);
if (CommentNode && CommentNode->MaterialExpressionComment)
{
CommentNode->MaterialExpressionComment->MaterialExpressionEditorX = CommentNode->NodePosX;
CommentNode->MaterialExpressionComment->MaterialExpressionEditorY = CommentNode->NodePosY;
CommentNode->MaterialExpressionComment->MarkPackageDirty();
CommentNode->MaterialDirtyDelegate.ExecuteIfBound();
}
}
}