Skip to content

Commit

Permalink
fix(blocks): incorrect viewport of embed linked doc with edgeless mode (
Browse files Browse the repository at this point in the history
#8785)

Close [BS-1881](https://linear.app/affine-design/issue/BS-1881/page内的edgeless-embed-缩放和坐标定位不太对)

This PR fixed the viewport is not fit to content if the synced doc block link to a edgeless mode doc. The test will be add in AFFiNE side.
  • Loading branch information
L-Sun committed Nov 21, 2024
1 parent ae6089b commit 83c2089
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export class EmbedEdgelessSyncedDocBlockComponent extends toEdgelessEmbedBlock(
EmbedSyncedDocBlockComponent
) {
protected override _renderSyncedView = () => {
const syncedDoc = this.syncedDoc;
const editorMode = this.syncedDocMode;
const { syncedDoc, editorMode } = this;

assertExists(syncedDoc, 'Doc should exist');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class EmbedSyncedDocBlockComponent extends EmbedBlockComponent<EmbedSynce

private _initEdgelessFitEffect = () => {
const fitToContent = () => {
if (this.syncedDocMode !== 'edgeless') return;
if (this.isPageMode) return;

const controller = this.syncedDocEditorHost?.std.getOptional(
GfxControllerIdentifier
Expand Down

0 comments on commit 83c2089

Please sign in to comment.