UNPKG

contra-ngx-img-cropper

Version:
43 lines 1.43 kB
import { Point } from './point'; import { CropperSettings } from '../cropperSettings'; var Handle = (function () { function Handle(x, y, radius, settings) { this.cropperSettings = new CropperSettings(); this.over = false; this.drag = false; this._position = new Point(x, y); this.offset = new Point(0, 0); this.radius = radius; this.cropperSettings = settings; } Handle.prototype.setDrag = function (value) { this.drag = value; this.setOver(value); }; Handle.prototype.draw = function (ctx) { // this should't be empty }; Handle.prototype.setOver = function (over) { this.over = over; }; Handle.prototype.touchInBounds = function (x, y) { return (x > this.position.x - this.radius + this.offset.x) && (x < this.position.x + this.radius + this.offset.x) && (y > this.position.y - this.radius + this.offset.y) && (y < this.position.y + this.radius + this.offset.y); }; Object.defineProperty(Handle.prototype, "position", { get: function () { return this._position; }, enumerable: true, configurable: true }); Handle.prototype.setPosition = function (x, y) { this._position.x = x; this._position.y = y; }; return Handle; }()); export { Handle }; //# sourceMappingURL=handle.js.map