Skip to content

Commit 26cb048

Browse files
committed
Fix deprecation warnings
1 parent 3a9d4e9 commit 26cb048

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@
3030
*.exe
3131
*.out
3232
*.app
33+
34+
# UE4/5
35+
36+
Binaries
37+
Intermediate

ColorWheelPlugin.uplugin

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"FileVersion": 3,
33
"Version": 1,
4-
"VersionName": "2020.1.4",
4+
"VersionName": "2023.1.1",
55
"FriendlyName": "Color Wheel",
66
"Description": "Simple no-nonsense bloated color wheel.",
77
"Category": "Widget",
@@ -10,7 +10,7 @@
1010
"DocsURL": "",
1111
"MarketplaceURL": "com.epicgames.launcher://ue/marketplace/product/ce01648a2cde41338991bb855a624ffa",
1212
"SupportURL": "https://portfolio.w2wizard.dev/",
13-
"EngineVersion": "4.27.0",
13+
"EngineVersion": "5.2",
1414
"CanContainContent": false,
1515
"Installed": false,
1616
"Modules": [

Source/ColorWheelPlugin/Private/SWColorWheel.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,27 +93,27 @@ FReply SWColorWheel::OnMouseMove(const FGeometry& MyGeometry, const FPointerEven
9393

9494
int32 SWColorWheel::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const
9595
{
96-
const ESlateDrawEffect DrawEffects = ShouldBeEnabled(bParentEnabled) ? ESlateDrawEffect::None : ESlateDrawEffect::DisabledEffect;
97-
const FVector2D CircleSize = AllottedGeometry.GetLocalSize() - SelectorImage->ImageSize;
98-
99-
// Draw the Color Wheel image
96+
const bool bIsEnabled = ShouldBeEnabled(bParentEnabled);
97+
const ESlateDrawEffect DrawEffects = bIsEnabled ? ESlateDrawEffect::None : ESlateDrawEffect::DisabledEffect;
98+
const FVector2f SelectorSize = SelectorImage->ImageSize;
99+
const FVector2f CircleSize = AllottedGeometry.GetLocalSize() - SelectorSize;
100+
100101
FSlateDrawElement::MakeBox(
101102
OutDrawElements,
102103
LayerId,
103-
AllottedGeometry.ToPaintGeometry(0.5 * SelectorImage->ImageSize, CircleSize),
104+
AllottedGeometry.ToPaintGeometry(CircleSize, FSlateLayoutTransform(0.5f * SelectorSize)),
104105
Image,
105106
DrawEffects,
106-
InWidgetStyle.GetColorAndOpacityTint() * HueCircleColorAndOpacity.Get().GetColor(InWidgetStyle) * Image->GetTint(InWidgetStyle)
107+
InWidgetStyle.GetColorAndOpacityTint() * Image->GetTint(InWidgetStyle)
107108
);
108109

109-
// Draw the Pin
110110
FSlateDrawElement::MakeBox(
111111
OutDrawElements,
112112
LayerId + 1,
113-
AllottedGeometry.ToPaintGeometry(0.5f * (AllottedGeometry.GetLocalSize() + CalcRelativePositionFromCenter() * CircleSize - SelectorImage->ImageSize), SelectorImage->ImageSize),
113+
AllottedGeometry.ToPaintGeometry(SelectorSize, FSlateLayoutTransform(0.5f * (AllottedGeometry.GetLocalSize() + CalcRelativePositionFromCenter() * FVector2D(CircleSize - SelectorSize)))),
114114
SelectorImage,
115115
DrawEffects,
116-
InWidgetStyle.GetColorAndOpacityTint() * PinColorAndOpacity.Get().GetColor(InWidgetStyle) * SelectorImage->GetTint(InWidgetStyle)
116+
InWidgetStyle.GetColorAndOpacityTint() * SelectorImage->GetTint(InWidgetStyle)
117117
);
118118

119119
return LayerId + 1;

0 commit comments

Comments
 (0)