"use strict";

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

var _color = require("../../utils/color");

var _default = require("../../constants/default");

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var GraphicModel = function GraphicModel(props) {
  _classCallCheck(this, GraphicModel);

  _defineProperty(this, "lineColor", 0x000000);

  _defineProperty(this, "lineAlpha", 0);

  _defineProperty(this, "lineWidth", 0);

  _defineProperty(this, "fill", 0x000000);

  _defineProperty(this, "fillAlpha", 0);

  _defineProperty(this, "width", 0);

  _defineProperty(this, "height", 0);

  _defineProperty(this, "points", []);

  _defineProperty(this, "radius", 0);

  _defineProperty(this, "lineAlignment", 0);

  Object.assign(this, props);
  this.fill = (0, _color.colorToHexNumber)(props.fill);
  this.lineColor = (0, _color.colorToHexNumber)(props.lineColor);
  this.fillAlpha = (0, _color.getColorAlpha)(props.fill);
  this.lineAlpha = (0, _color.getColorAlpha)(props.lineColor);
  var lineAlignment = props.lineAlignment || 'middle';
  this.lineAlignment = _default.LINE_ALIGNMENTS[lineAlignment] || 0;
};

exports.default = GraphicModel;