mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(editor): adjustment of scaled and folded synced doc (#12294)
Close [BS-3418](https://linear.app/affine-design/issue/BS-3418/折叠的embed-doc调整宽度时,会出现一个最小高度,不需要这个) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for dynamically scaling the height of embedded synced document blocks, including proper handling when folding and unfolding. - Introduced a new property to track the scaled height of folded synced document blocks. - **Bug Fixes** - Improved accuracy of height calculations for synced document blocks by accounting for both viewport zoom and block scale. - **Tests** - Enhanced end-to-end tests to consistently apply scaling before running size adjustment checks. - Added a utility function to simulate scaling elements with keyboard shortcuts during test execution. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -43,7 +43,7 @@ const ToggleButton = ({ model }: { model: EmbedSyncedDocModel }) => {
|
||||
model.props.preFoldHeight$.value = 0;
|
||||
} else {
|
||||
model.props.preFoldHeight$.value = h;
|
||||
model.props.xywh$.value = `[${x},${y},${w},${styles.headerHeight}]`;
|
||||
model.props.xywh$.value = `[${x},${y},${w},${styles.headerHeight * (model.props.scale ?? 1)}]`;
|
||||
}
|
||||
});
|
||||
}, [model]);
|
||||
|
||||
Reference in New Issue
Block a user