diff --git a/CHANGELOG.md b/CHANGELOG.md index cf554ef3c..19370ecb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,12 +18,15 @@ * **Breaking Changes** * **Additions** +* Removed dependency on STL throughout the code base, cutting down on the LOC that need parsing by 66%. ### Cocos2d-x ### SFML ### UE4 +* `SpineWidget` now supports the full widget transform, including rendering scale/shear. +* **Breaking changes**: `SpineWidget` no longer has the `Scale` property. Instead the size x/y properties can be used. ## C# ## * **Breaking changes** diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp index 09aa05260..94f86444b 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp @@ -171,12 +171,12 @@ void SSpineWidget::Flush(int32 LayerId, FSlateWindowElementList& OutDrawElements if (Vertices.Num() == 0) return; SSpineWidget* self = (SSpineWidget*)this; - const FVector2D widgetSize = AllottedGeometry.GetDrawSize(); + const FVector2D widgetSize = AllottedGeometry.GetLocalSize(); const FVector2D sizeScale = widgetSize / FVector2D(boundsSize.X, boundsSize.Y); const float setupScale = sizeScale.GetMin(); for (int i = 0; i < Vertices.Num(); i++) { - Vertices[i] = (Vertices[i] + FVector(-boundsMin.X - boundsSize.X / 2, boundsMin.Y + boundsSize.Y / 2, 0)) * setupScale * widget->Scale + FVector(widgetSize.X / 2, widgetSize.Y / 2, 0); + Vertices[i] = (Vertices[i] + FVector(-boundsMin.X - boundsSize.X / 2, boundsMin.Y + boundsSize.Y / 2, 0)) * setupScale + FVector(widgetSize.X / 2, widgetSize.Y / 2, 0); } self->renderData.IndexData.SetNumUninitialized(Indices.Num()); @@ -189,9 +189,10 @@ void SSpineWidget::Flush(int32 LayerId, FSlateWindowElementList& OutDrawElements FSlateVertex* vertexData = (FSlateVertex*)renderData.VertexData.GetData(); FVector2D offset = AllottedGeometry.AbsolutePosition; FColor white = FColor(0xffffffff); + const FSlateRenderTransform& Transform = AllottedGeometry.GetAccumulatedRenderTransform(); for (size_t i = 0; i < (size_t)Vertices.Num(); i++) { - setVertex(&vertexData[i], Vertices[i].X, Vertices[i].Y, Uvs[i].X, Uvs[i].Y, Colors[i], offset); + setVertex(&vertexData[i], 0, 0, Uvs[i].X, Uvs[i].Y, Colors[i], Transform.TransformPoint(FVector2D(Vertices[i]))); } brush = &widget->Brush; diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineWidget.h b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineWidget.h index 060f24734..7a00bd894 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineWidget.h +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineWidget.h @@ -51,8 +51,6 @@ public: #if WITH_EDITOR virtual const FText GetPaletteCategory() override; #endif - UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadWrite) - float Scale = 1; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Spine) USpineAtlasAsset* Atlas;