so thats the subject, when im rotating image inside my canvas panel with bAutosize on, my widget cashed geometry shows same size, is there other way to rotate texture in UImage?
i found solution in my case, im creating another cavas panel with rotated size as body and putting image with offset inside it
TSharedRef<SWidget> UDraggingItemWidget::RebuildWidget()
{
// Construction
if (!bIsConstructed)
{
// Set Up Root Widget
RootWidget = Cast<UPanelWidget>(GetRootWidget());
RootWidget = WidgetTree->ConstructWidget<UCanvasPanel>(UCanvasPanel::StaticClass(), (TEXT("Root")));
UCanvasPanelSlot *RootWidgetSlot = Cast<UCanvasPanelSlot>(RootWidget->Slot);
WidgetTree->RootWidget = RootWidget;
RootWidget->SetVisibility(ESlateVisibility::HitTestInvisible);
// Create Body
Body = WidgetTree->ConstructWidget<UCanvasPanel>(UCanvasPanel::StaticClass(), (TEXT("Body")));
RootWidget->AddChild(Body);
// Create Item Icon
ItemIcon = WidgetTree->ConstructWidget<UImage>(UImage::StaticClass(), (TEXT("Item Icon")));
Body->AddChild(ItemIcon);
UCanvasPanelSlot *ItemIconSlot = Cast<UCanvasPanelSlot>(ItemIcon->Slot);
ItemIconSlot->SetAutoSize(true);
bIsConstructed = true;
}
if (dragitem)
{
// Configure
UCanvasPanelSlot *BodySlot = Cast<UCanvasPanelSlot>(Body->Slot);
BodySlot->SetSize(dragitem->GetRotatedSize() * inventoryslotpixelsize);
ItemIcon->SetBrushFromTexture(dragitem->GetIcon());
ItemIcon->Brush.TintColor = dragitem->GetIconTintColor();
ItemIcon->Brush.ImageSize = dragitem->GetNormalSize() * inventoryslotpixelsize;
ItemIcon->SetRenderAngle(dragitem->GetRotation());
UCanvasPanelSlot *ItemIconSlot = Cast<UCanvasPanelSlot>(ItemIcon->Slot);
ItemIconSlot->SetAnchors(FAnchors(0.5, 0.5, 0.5, 0.5));
ItemIconSlot->SetPosition(-dragitem->GetNormalSize() * inventoryslotpixelsize / 2);
}
TSharedRef<SWidget> Widget = Super::RebuildWidget();
return Widget;
}
this canvas panel named body is giving geometry size to widget.