Skip to content

Commit

Permalink
fix: fix isRenderManagerService
Browse files Browse the repository at this point in the history
  • Loading branch information
wzhudev committed Apr 21, 2024
1 parent 8f3835a commit 3572ae0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/docs-ui/src/views/doc-canvas-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class DocCanvasView extends RxDisposable {
readonly fps$ = this._fps$.asObservable();

constructor(
@IRenderManagerService private readonly _renderManagerService: RenderManagerService,
@IRenderManagerService private readonly _renderManagerService: IRenderManagerService,
@IConfigService private readonly _configService: IConfigService,
@IUniverInstanceService private readonly _univerInstanceService: IUniverInstanceService,
@IEditorService private readonly _editorService: IEditorService
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-render/src/render-manager/render-unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface IRenderContext<T extends UnitModel = UnitModel> extends IRender
* This class is responsible
*/
export class RenderUnit extends Disposable implements IRender {
// These declared fields would be assigned right after it is instantiated in `RenderManagerService.createRender`.
readonly isRenderUnit: true;

readonly unitId: string;
readonly type: UnitType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface ISheetObjectParam {
}

function isRenderManagerService(renderManagerService: IRenderManagerService | IRenderContext): renderManagerService is IRenderManagerService {
return !!(renderManagerService as any).defaultEngine;
return typeof (renderManagerService as IRenderContext).isMainScene !== 'undefined';
}

export function getSheetObject(
Expand Down

0 comments on commit 3572ae0

Please sign in to comment.