"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RollScaleTransformMC = void 0;
const core_1 = require("@vived/core");
const MouseInput_1 = require("../../../MouseInput");
const UC_1 = require("../../UC");
class RollScaleTransformMC extends core_1.AppObjectController {
    constructor(appObject) {
        super(appObject, RollScaleTransformMC.type);
        this.allow = (e) => {
            return true;
        };
        this.onWheel = (e) => {
            if (!this.allow(e))
                return;
            if (!this.bumpScaleUC) {
                return;
            }
            this.bumpScaleUC.bump(e.event.deltaY > 0 ? "OUT" : "IN", e.position);
        };
        this.bumpScaleUC = appObject.getComponent(UC_1.BumpTransformScaleAboutPixelPointUC.type);
        if (!this.bumpScaleUC) {
            this.error("Controller has been added to an App Object that does not have BumpTransformScaleAboutPixelPointUC. Add one first.");
            return;
        }
        const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
        if (mouseInput) {
            mouseInput.registerController(this);
        }
        else {
            this.error("Unable to find MouseInputEntity");
        }
    }
}
exports.RollScaleTransformMC = RollScaleTransformMC;
RollScaleTransformMC.type = "RollScaleTransformMC";
//# sourceMappingURL=RollScaleTransformMC.js.map