"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.behavior = void 0;

var _reactPixiFiber = require("react-pixi-fiber");

var PIXI = _interopRequireWildcard(require("pixi.js"));

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }

var TYPE = 'Circle';
var behavior = {
  customDisplayObject: function customDisplayObject(props) {
    return new PIXI.Graphics();
  },
  customApplyProps: function customApplyProps(instance, oldProps, newProps) {
    var _newProps$fill = newProps.fill,
        fill = _newProps$fill === void 0 ? 0xFFFFFF : _newProps$fill,
        top = newProps.top,
        left = newProps.left,
        radius = newProps.radius,
        _newProps$lineWidth = newProps.lineWidth,
        lineWidth = _newProps$lineWidth === void 0 ? 1 : _newProps$lineWidth,
        _newProps$lineColor = newProps.lineColor,
        lineColor = _newProps$lineColor === void 0 ? 0xFFFFFF : _newProps$lineColor,
        _newProps$lineAlpha = newProps.lineAlpha,
        lineAlpha = _newProps$lineAlpha === void 0 ? 1 : _newProps$lineAlpha,
        _newProps$lineAlignme = newProps.lineAlignment,
        lineAlignment = _newProps$lineAlignme === void 0 ? 1 : _newProps$lineAlignme,
        _newProps$fillAlpha = newProps.fillAlpha,
        fillAlpha = _newProps$fillAlpha === void 0 ? 1 : _newProps$fillAlpha;
    instance.clear();
    instance.lineStyle(lineWidth, lineColor, lineAlpha, lineAlignment);
    instance.beginFill(fill, fillAlpha);
    instance.drawCircle(left + radius, top + radius, radius);
    instance.endFill();
  }
};
exports.behavior = behavior;

var _default = (0, _reactPixiFiber.CustomPIXIComponent)(behavior, TYPE);

exports.default = _default;