import { AppObjectController } from "@vived/core";
import { MouseInputEntity, } from "../../MouseInput";
import { BumpSceneRootScaleAboutPixelPointUC } from "../UC/BumpSceneRootScaleAboutPixelPoint";
export class MouseRoll extends AppObjectController {
    get bumpRootScaleUC() {
        return this.getCachedLocalComponent(BumpSceneRootScaleAboutPixelPointUC.type);
    }
    constructor(appObject) {
        super(appObject, MouseRoll.type);
        this.allow = (e) => {
            return true;
        };
        this.onWheel = (e) => {
            if (!this.allow(e))
                return;
            if (!this.bumpRootScaleUC) {
                return;
            }
            this.bumpRootScaleUC.bump(e.event.deltaY > 0 ? "OUT" : "IN", e.position);
        };
        const mouseInput = MouseInputEntity.get(this.appObjects);
        if (mouseInput) {
            mouseInput.registerController(this);
        }
        else {
            this.warn("Unable to find MouseInputEntity");
        }
    }
}
MouseRoll.type = "MouseRoll";
//# sourceMappingURL=MouseRoll.js.map