"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MouseRoll = void 0;
const core_1 = require("@vived/core");
const MouseInput_1 = require("../../MouseInput");
const BumpSceneRootScaleAboutPixelPoint_1 = require("../UC/BumpSceneRootScaleAboutPixelPoint");
class MouseRoll extends core_1.AppObjectController {
    get bumpRootScaleUC() {
        return this.getCachedLocalComponent(BumpSceneRootScaleAboutPixelPoint_1.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 = MouseInput_1.MouseInputEntity.get(this.appObjects);
        if (mouseInput) {
            mouseInput.registerController(this);
        }
        else {
            this.warn("Unable to find MouseInputEntity");
        }
    }
}
exports.MouseRoll = MouseRoll;
MouseRoll.type = "MouseRoll";
//# sourceMappingURL=MouseRoll.js.map