UNPKG

cione-comp-lib

Version:

`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`

51 lines (50 loc) 1.63 kB
import { __extends } from "../../../tslib/tslib.es6.mjs"; import Path from "./Path.mjs"; var CompoundPath = function(_super) { __extends(CompoundPath2, _super); function CompoundPath2() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.type = "compound"; return _this; } CompoundPath2.prototype._updatePathDirty = function() { var paths = this.shape.paths; var dirtyPath = this.shapeChanged(); for (var i = 0; i < paths.length; i++) { dirtyPath = dirtyPath || paths[i].shapeChanged(); } if (dirtyPath) { this.dirtyShape(); } }; CompoundPath2.prototype.beforeBrush = function() { this._updatePathDirty(); var paths = this.shape.paths || []; var scale = this.getGlobalScale(); for (var i = 0; i < paths.length; i++) { if (!paths[i].path) { paths[i].createPathProxy(); } paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold); } }; CompoundPath2.prototype.buildPath = function(ctx, shape) { var paths = shape.paths || []; for (var i = 0; i < paths.length; i++) { paths[i].buildPath(ctx, paths[i].shape, true); } }; CompoundPath2.prototype.afterBrush = function() { var paths = this.shape.paths || []; for (var i = 0; i < paths.length; i++) { paths[i].pathUpdated(); } }; CompoundPath2.prototype.getBoundingRect = function() { this._updatePathDirty.call(this); return Path.prototype.getBoundingRect.call(this); }; return CompoundPath2; }(Path); var CompoundPath$1 = CompoundPath; export { CompoundPath$1 as default };