Skip to content

Commit

Permalink
Removed custom scope guard and replaced it with TGuardValue defined i…
Browse files Browse the repository at this point in the history
…n the engine.
  • Loading branch information
segross committed Jun 28, 2020
1 parent c7d36a8 commit 5b737e1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 65 deletions.
1 change: 0 additions & 1 deletion Source/ImGui/Private/ImGuiContextManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "ImGuiDelegatesContainer.h"
#include "ImGuiImplementation.h"
#include "ImGuiModuleSettings.h"
#include "Utilities/ScopeGuards.h"
#include "Utilities/WorldContext.h"
#include "Utilities/WorldContextIndex.h"

Expand Down
58 changes: 0 additions & 58 deletions Source/ImGui/Private/Utilities/ScopeGuards.h

This file was deleted.

9 changes: 3 additions & 6 deletions Source/ImGui/Private/Widgets/SImGuiWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "ImGuiModuleSettings.h"
#include "TextureManager.h"
#include "Utilities/Arrays.h"
#include "Utilities/ScopeGuards.h"
#include "VersionCompatibility.h"

#include <Engine/Console.h>
Expand Down Expand Up @@ -647,10 +646,6 @@ int32 SImGuiWidget::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeo
{
#if ENGINE_COMPATIBILITY_LEGACY_CLIPPING_API
DrawList.CopyVertexData(VertexBuffer, ImGuiToScreen, VertexClippingRect);

// Get access to the Slate scissor rectangle defined in Slate Core API, so we can customize elements drawing.
extern SLATECORE_API TOptional<FShortRect> GSlateScissorRect;
auto GSlateScissorRectSaver = ScopeGuards::MakeStateSaver(GSlateScissorRect);
#else
DrawList.CopyVertexData(VertexBuffer, ImGuiToScreen);
#endif // ENGINE_COMPATIBILITY_LEGACY_CLIPPING_API
Expand All @@ -672,7 +667,9 @@ int32 SImGuiWidget::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeo
const FSlateRect ClippingRect = DrawCommand.ClippingRect.IntersectionWith(MyClippingRect);

#if ENGINE_COMPATIBILITY_LEGACY_CLIPPING_API
GSlateScissorRect = FShortRect{ ClippingRect };
// Get access to the Slate scissor rectangle defined in Slate Core API, so we can customize elements drawing.
extern SLATECORE_API TOptional<FShortRect> GSlateScissorRect;
TGuardValue<TOptional<FShortRect>> GSlateScissorRecGuard(GSlateScissorRect, FShortRect{ ClippingRect });
#else
OutDrawElements.PushClip(FSlateClippingZone{ ClippingRect });
#endif // ENGINE_COMPATIBILITY_LEGACY_CLIPPING_API
Expand Down

0 comments on commit 5b737e1

Please sign in to comment.