|
@@ -172,9 +172,11 @@ void SSpineWidget::Flush(int32 LayerId, FSlateWindowElementList& OutDrawElements
|
|
|
SSpineWidget* self = (SSpineWidget*)this;
|
|
|
|
|
|
const FVector2D widgetSize = AllottedGeometry.GetDrawSize();
|
|
|
- const float setupScale = (widgetSize / FVector2D(boundsSize.X, boundsSize.Y)).GetMin();
|
|
|
+ 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, -(boundsMin.Y + boundsSize.Y), 0)) * setupScale * widget->Scale;
|
|
|
+ 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);
|
|
|
}
|
|
|
|
|
|
self->renderData.IndexData.SetNumUninitialized(Indices.Num());
|
|
@@ -186,9 +188,6 @@ void SSpineWidget::Flush(int32 LayerId, FSlateWindowElementList& OutDrawElements
|
|
|
FVector2D offset = AllottedGeometry.AbsolutePosition;
|
|
|
FColor white = FColor(0xffffffff);
|
|
|
|
|
|
- float width = AllottedGeometry.GetAbsoluteSize().X;
|
|
|
- float height = AllottedGeometry.GetAbsoluteSize().Y;
|
|
|
-
|
|
|
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);
|
|
|
}
|