import { AppObjectController } from "@vived/core";
import { MouseInputEntity, } from "../../MouseInput";
import { FocusOnPixelUC } from "../UC/FocusOnPixel";
export class MouseDoubleClickToRecenter extends AppObjectController {
    get focusUC() {
        return this.getCachedLocalComponent(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 = MouseInputEntity.get(this.appObjects);
        if (mouseInput) {
            mouseInput.registerController(this);
        }
        else {
            this.warn("Unable to find MouseInputEntity");
        }
    }
}
MouseDoubleClickToRecenter.type = "MouseDoubleClickToRecenter";
//# sourceMappingURL=MouseDoubleClickToRecenter.js.map