segross / UnrealImGui

Unreal plug-in that integrates Dear ImGui framework into Unreal Engine 4.
MIT License
666 stars 211 forks source link

Upgrade to 5.2 #83

Open erikpa1 opened 1 year ago

erikpa1 commented 1 year ago

Hi in 5.2 there is problem in compilation

of this code segment:


FReply SImGuiCanvasControl::OnDragOver(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent)
{
    auto Operation = DragDropEvent.GetOperationAs<FImGuiDragDropOperation>();
    if (Operation.IsValid())
    {
        const FSlateRenderTransform ScreenToWidget = MyGeometry.GetAccumulatedRenderTransform().Inverse();
        const FVector2D DragDelta = ScreenToWidget.TransformVector(DragDropEvent.GetScreenSpacePosition() - Operation->StartPosition);

        if (Operation->DragType == EDragType::Content)
        {
            // Content offset is in ImGui space, so we need to scale drag calculated in widget space.
            ContentOffset = Operation->StartOffset + DragDelta / CanvasScale;
        }
        else
        {
            // Canvas offset is in widget space, so we can apply drag calculated in widget space directly.
            CanvasOffset = Operation->StartOffset + DragDelta;
        }

        UpdateRenderTransform();

        return FReply::Handled();
    }
    else
    {
        return FReply::Unhandled();
    }
}

Because of error:

1>C:\Work\unrealprojects\UEVtsCore\Plugins\ImGui\Source\ImGui\Private\Widgets\SImGuiCanvasControl.cpp(179): error C2440: 'initializing': cannot convert from 'UE::Math::TVector2<float>' to 'UE::Math::TVector2<double>'
1>C:\Work\unrealprojects\UEVtsCore\Plugins\ImGui\Source\ImGui\Private\Widgets\SImGuiCanvasControl.cpp(179): note: Constructor for struct 'UE::Math::TVector2<double>' is declared 'explicit'
jonpas commented 10 months ago

https://github.com/IDI-Systems/UnrealImGui supports Unreal Engine 5.2 and 5.3.