Files
UnrealEngineUWP/Engine/Source/Editor/ViewportInteraction/ViewportDragOperation.cpp
Marcus Wassmer cbfcbbb93b Merging //UE4/Dev-Main@4662404 to Dev-Rendering (//UE4/Dev-Rendering)
#rb none
Should be just copyright updates

[CL 4680440 by Marcus Wassmer in Dev-Rendering branch]
2019-01-03 19:16:26 -05:00

47 lines
1.1 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "ViewportDragOperation.h"
#include "ViewportInteractionTypes.h"
UViewportDragOperationComponent::UViewportDragOperationComponent() :
Super(),
DragOperation(nullptr)
{
}
UViewportDragOperation* UViewportDragOperationComponent::GetDragOperation()
{
return DragOperation;
}
void UViewportDragOperationComponent::SetDragOperationClass( const TSubclassOf<UViewportDragOperation> InDragOperation )
{
DragOperationSubclass = InDragOperation;
}
void UViewportDragOperationComponent::StartDragOperation()
{
if ( DragOperationSubclass )
{
// Reset the drag operation to make sure we start a new one
ClearDragOperation();
// Create the drag object with the latest class
DragOperation = NewObject<UViewportDragOperation>( ( UObject* ) GetTransientPackage(), DragOperationSubclass );
}
}
void UViewportDragOperationComponent::ClearDragOperation()
{
if (DragOperation)
{
DragOperation->MarkPendingKill();
}
DragOperation = nullptr;
}
bool UViewportDragOperationComponent::IsDragging() const
{
return DragOperation != nullptr;
}