Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(doc): fix canvas render blanck

DR-Univer3a331b25cc03
diff --git a/packages/base-render/src/Viewport.ts b/packages/base-render/src/Viewport.ts
index 79a21c560c..7827501642 100644
--- a/packages/base-render/src/Viewport.ts
+++ b/packages/base-render/src/Viewport.ts
@@ -373,7 +373,7 @@ export class Viewport {
}
render(parentCtx?: CanvasRenderingContext2D) {
- const mainCtx = parentCtx;
+ const mainCtx = parentCtx || this._scene.getEngine()?.getCanvas().getContext();
// console.log(this.viewPortKey, this._cacheCanvas);
if (!this.isDirty() && this._allowCache) {
this._applyCache(mainCtx);