import { Vector2 } from "@vived/core";
import { PixelToSceneRayUC } from "../../Babylon/UC/PixelToSceneRayUC";
import { FramedScreenEntity } from "../../FramedScreen/Entities/FramedScreenEntity";
import { DragLabelDropUC } from "../UseCases/DragLabelDropUC";
export function releaseLabelDropAnswerItemScreen(screenX, screenY, appObjects) {
    const uc = DragLabelDropUC.get(appObjects);
    if (!uc) {
        appObjects.submitWarning("releaseLabelDropAnswerItem", "Unable to find DragLabelDropUC");
        return;
    }
    let pickOffsetX = 0;
    let pickOffsetY = 0;
    const framedScreen = appObjects.getSingleton(FramedScreenEntity.type);
    const renderCanvas = framedScreen?.getContainerByID("Render_Canvas");
    if (renderCanvas) {
        pickOffsetX += renderCanvas.position.x;
        pickOffsetY += renderCanvas.position.y;
    }
    const ray = PixelToSceneRayUC.get(appObjects)?.pixelToSceneRay(new Vector2(screenX - pickOffsetX, screenY - pickOffsetY));
    if (ray) {
        uc.release(ray);
    }
}
//# sourceMappingURL=releaseLabelDropAnswerItemScreen.js.map