"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateTouchInputBoundUC = void 0;
const core_1 = require("@vived/core");
const FramedScreen_1 = require("../../FramedScreen");
const Entities_1 = require("../Entities");
class UpdateTouchInputBoundUC extends core_1.AppObjectUC {
    constructor(appObject) {
        super(appObject, UpdateTouchInputBoundUC.type);
        this.onRenderCanvasChange = () => {
            this.touchInput?.updateInputElementBounds();
        };
        this.touchInput = Entities_1.TouchInputEntity.get(appObject.appObjectRepo);
        if (!this.touchInput) {
            this.warn("Unable to find TouchInputEntity");
            return;
        }
        const pm = appObject.getComponent(FramedScreen_1.FramedContainerPM.type);
        if (!pm) {
            this.warn("Unable to find FramedContainerPM");
            return;
        }
        pm.addView(this.onRenderCanvasChange);
        this.onRenderCanvasChange();
    }
}
exports.UpdateTouchInputBoundUC = UpdateTouchInputBoundUC;
UpdateTouchInputBoundUC.type = "UpdateTouchInputBoundUC";
//# sourceMappingURL=UpdateTouchInputBound.js.map