UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PaintGeometry.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
9
24{
34
41 float DrawScale;
42
45
47 const FSlateRenderTransform& GetAccumulatedRenderTransform() const { return AccumulatedRenderTransform; }
48
55 {
56 if (!bUsingLegacyConstructor) return;
57
58 AccumulatedRenderTransform = FSlateRenderTransform(DrawScale, DrawPosition);
61 }
62
63 bool HasRenderTransform() const { return bHasRenderTransform; }
64
65private:
66 // Mutable to support legacy constructors. Doesn't account for render transforms.
67 mutable FVector2f DrawSize;
68
69 // Mutable to support legacy constructors.
70 mutable FVector2f LocalSize;
71
72 // final render transform for drawing. Transforms from local space to window space for the draw element.
73 // Mutable to support legacy constructors.
74 mutable FSlateRenderTransform AccumulatedRenderTransform;
75
76 // Support legacy constructors.
77 uint8 bUsingLegacyConstructor : 1;
78
79 uint8 bHasRenderTransform : 1;
80
81public:
84 : DrawPosition(0.0f, 0.0f)
85 , DrawScale(1.0f)
86 , DrawSize(0.0f, 0.0f)
87 , LocalSize(0.0f, 0.0f)
88 , AccumulatedRenderTransform()
89 , bUsingLegacyConstructor(true)
90 , bHasRenderTransform(false)
91 {}
92
103 , DrawSize(0.0f, 0.0f)
104 , LocalSize(InLocalSize)
105 , AccumulatedRenderTransform(InAccumulatedRenderTransform)
106 , bUsingLegacyConstructor(false)
107 , bHasRenderTransform(bInHasRenderTransform)
108 {
109 }
110
111 // !!! DEPRECATED!!! This is legacy and should be removed!
115 , DrawSize(InDrawSize)
116 , LocalSize(0.0f, 0.0f)
117 , AccumulatedRenderTransform()
118 , bUsingLegacyConstructor(true)
119 , bHasRenderTransform(false)
120 {
121 }
122
132 {
133 AccumulatedRenderTransform = ::Concatenate(AccumulatedRenderTransform, LayoutTransform);
136 }
137
144 {
145 AccumulatedRenderTransform = RenderTransform;
146 }
147};
148
149
150template<> struct TIsPODType<FPaintGeometry> { enum { Value = true }; };
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
FTransform2D FSlateRenderTransform
Definition SlateRenderTransform.h:9
VectorType TransformVector(const TransformType &Transform, const VectorType &Vector)
Definition TransformCalculus.h:367
PositionType TransformPoint(const TransformType &Transform, const PositionType &Point)
Definition TransformCalculus.h:358
ConcatenateRules< TransformTypeA, TransformTypeB >::ResultType Concatenate(const TransformTypeA &LHS, const TransformTypeB &RHS)
Definition TransformCalculus.h:293
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition SlateLayoutTransform.h:20
Definition TransformCalculus2D.h:682
FDeprecateSlateVector2D FDeprecateVector2DResult
Definition SlateVector2.h:469
@ false
Definition radaudio_common.h:23
Definition PaintGeometry.h:24
void AppendTransform(const FSlateLayoutTransform &LayoutTransform)
Definition PaintGeometry.h:131
UE::Slate::FDeprecateVector2DResult GetLocalSize() const
Definition PaintGeometry.h:44
FVector2f DrawPosition
Definition PaintGeometry.h:33
FPaintGeometry(UE::Slate::FDeprecateVector2DParameter InDrawPosition, UE::Slate::FDeprecateVector2DParameter InDrawSize, float InDrawScale)
Definition PaintGeometry.h:112
const FSlateRenderTransform & GetAccumulatedRenderTransform() const
Definition PaintGeometry.h:47
FPaintGeometry(const FSlateLayoutTransform &InAccumulatedLayoutTransform, const FSlateRenderTransform &InAccumulatedRenderTransform, const UE::Slate::FDeprecateVector2DParameter &InLocalSize, bool bInHasRenderTransform)
Definition PaintGeometry.h:100
void CommitTransformsIfUsingLegacyConstructor() const
Definition PaintGeometry.h:54
float DrawScale
Definition PaintGeometry.h:41
void SetRenderTransform(const FSlateRenderTransform &RenderTransform)
Definition PaintGeometry.h:143
bool HasRenderTransform() const
Definition PaintGeometry.h:63
FPaintGeometry()
Definition PaintGeometry.h:83
Definition IsPODType.h:12
@ Value
Definition IsPODType.h:13
Definition SlateVector2.h:485