@visactor/vrender-core
Version:
```typescript import { xxx } from '@visactor/vrender-core'; ```
61 lines (55 loc) • 2.6 kB
JavaScript
;
var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
}, __metadata = this && this.__metadata || function(k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
}, __param = this && this.__param || function(paramIndex, decorator) {
return function(target, key) {
decorator(target, key, paramIndex);
};
};
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.DefaultRenderService = void 0;
const inversify_lite_1 = require("../common/inversify-lite"), render_1 = require("./contributions/render");
let DefaultRenderService = class {
constructor(drawContribution) {
this.drawContribution = drawContribution;
}
prepare(updateBounds) {
updateBounds && this.renderTreeRoots.forEach((g => {
this._prepare(g, updateBounds);
}));
}
_prepare(g, updateBounds) {
g.forEachChildren((g => {
this._prepare(g, updateBounds);
})), g.update({
bounds: updateBounds,
trans: !0
});
}
prepareRenderList() {}
beforeDraw(params) {}
draw(params) {
this.drawContribution.draw(this, Object.assign({}, this.drawParams));
}
afterDraw(params) {
this.drawContribution.afterDraw && this.drawContribution.afterDraw(this, Object.assign({}, this.drawParams));
}
reInit() {
this.drawContribution.reInit();
}
render(groups, params) {
this.renderTreeRoots = groups, this.drawParams = params;
const updateBounds = params.updateBounds;
this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params),
this.afterDraw(params), this.drawParams = null;
}
};
DefaultRenderService = __decorate([ (0, inversify_lite_1.injectable)(), __param(0, (0,
inversify_lite_1.inject)(render_1.DrawContribution)), __metadata("design:paramtypes", [ Object ]) ], DefaultRenderService),
exports.DefaultRenderService = DefaultRenderService;
//# sourceMappingURL=render-service.js.map