@visactor/vrender-core
Version:
```typescript import { xxx } from '@visactor/vrender-core'; ```
44 lines (39 loc) • 1.41 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.EmptyLayerHandlerContribution = void 0;
const application_1 = require("../../../application");
class EmptyLayerHandlerContribution {
constructor() {
this.offscreen = !1, this.type = "virtual", this.global = application_1.application.global;
}
setDpr(dpr) {}
init(layer, window, params) {
if (this.layer = layer, this.window = window, params.main) throw new Error("virtual layer不能作为main layer");
this.main = !1, this.canvas = null, this.context = null;
}
resize(w, h) {}
resizeView(w, h) {}
render(group, params, userParams) {
this.mainHandler.render(group, params, Object.assign(Object.assign({}, userParams), {
clear: !1
}));
}
merge(layerHandlers) {}
prepare(dirtyBounds, params) {}
drawTo(target, group, params) {
var _a;
const context = target.getContext();
params.renderService.render(group, Object.assign(Object.assign({
context: context
}, params), {
clear: params.clear ? null !== (_a = params.background) && void 0 !== _a ? _a : "#fff" : void 0
}));
}
getContext() {
return null;
}
release() {}
}
exports.EmptyLayerHandlerContribution = EmptyLayerHandlerContribution;
//# sourceMappingURL=empty-contribution.js.map