shape.js 1010 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. exports.__esModule = true;
  3. exports["default"] = void 0;
  4. var _base = _interopRequireDefault(require("./base"));
  5. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  6. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  7. var Shape = /*#__PURE__*/function (_Base) {
  8. _inheritsLoose(Shape, _Base);
  9. function Shape(cfg) {
  10. var _this;
  11. _this = _Base.call(this, cfg) || this;
  12. _this.names = ['shape'];
  13. _this.type = 'shape';
  14. _this.gradient = null;
  15. return _this;
  16. }
  17. /**
  18. * @override
  19. */
  20. var _proto = Shape.prototype;
  21. _proto.getLinearValue = function getLinearValue(percent) {
  22. var values = this.values;
  23. var index = Math.round((values.length - 1) * percent);
  24. return values[index];
  25. };
  26. return Shape;
  27. }(_base["default"]);
  28. var _default = Shape;
  29. exports["default"] = _default;