"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MouseDoubleClickToRecenter = void 0;
const core_1 = require("@vived/core");
const MouseInput_1 = require("../../MouseInput");
const FocusOnPixel_1 = require("../UC/FocusOnPixel");
class MouseDoubleClickToRecenter extends core_1.AppObjectController {
    get focusUC() {
        return this.getCachedLocalComponent(FocusOnPixel_1.FocusOnPixelUC.type);
    }
    constructor(appObject) {
        super(appObject, MouseDoubleClickToRecenter.type);
        this.focusDurationMS = 500;
        this.allow = (e) => {
            return true;
        };
        this.onDoubleClick = (e) => {
            if (this.allow(e)) {
                this.focusUC?.centerOnPixel(e.position);
            }
        };
        const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
        if (mouseInput) {
            mouseInput.registerController(this);
        }
        else {
            this.warn("Unable to find MouseInputEntity");
        }
    }
}
exports.MouseDoubleClickToRecenter = MouseDoubleClickToRecenter;
MouseDoubleClickToRecenter.type = "MouseDoubleClickToRecenter";
//# sourceMappingURL=MouseDoubleClickToRecenter.js.map