Files
UnrealEngineUWP/Engine/Source/Editor/GraphEditor/Public/SGraphPreviewer.h
thomas sarkanen 084d39f98c Fix flicker in graph preview in anim state machines
Stopped zooming every frame, and only update the graph when it is created.

#jira UE-64870 - Animation State Preview Window Jitters with certain states
#rb Jurre.deBaare

#ROBOMERGE-SOURCE: CL 4466680 in //UE4/Release-4.21/...
#ROBOMERGE-BOT: RELEASE (Release-4.21 -> Release-Staging-4.21)

[CL 4466681 by thomas sarkanen in Staging-4.21 branch]
2018-10-15 09:21:14 -04:00

40 lines
1.2 KiB
C++

// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/SCompoundWidget.h"
class SGraphPanel;
class UEdGraph;
// This widget provides a fully-zoomed-out preview of a specified graph
class GRAPHEDITOR_API SGraphPreviewer : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SGraphPreviewer)
: _ShowGraphStateOverlay(true)
{}
SLATE_ATTRIBUTE( FText, CornerOverlayText )
/** Show overlay elements for the graph state such as the PIE and read-only borders and text */
SLATE_ATTRIBUTE(bool, ShowGraphStateOverlay)
SLATE_ARGUMENT( TSharedPtr<SWidget>, TitleBar )
SLATE_END_ARGS()
void Construct(const FArguments& InArgs, UEdGraph* InGraphObj);
private:
/** Helper function used to refresh the graph */
EActiveTimerReturnType RefreshGraphTimer(const double InCurrentTime, const float InDeltaTime);
protected:
/// The Graph we are currently viewing
UEdGraph* EdGraphObj;
// As node's bounds dont get updated immediately, to truly zoom out to fit we need to tick a few times
int32 NeedsRefreshCounter;
// The underlying graph panel
TSharedPtr<SGraphPanel> GraphPanel;
};