fix(editor): limit max width when uploading or pasting image into edgeless (#9273)

[BS-2180](https://linear.app/affine-design/issue/BS-2180/白板中粘贴图片,限定一下最大宽度)
This commit is contained in:
donteatfriedrice
2024-12-24 06:28:59 +00:00
parent 4ce5cf20c3
commit 338835a4aa
7 changed files with 34 additions and 14 deletions
@@ -339,7 +339,7 @@ function responseToCreateImage(host: EditorHost) {
const [x, y] = edgelessRoot.service.viewport.toViewCoord(minX, minY);
host.doc.transact(() => {
addImages(edgelessRoot.std, [img], [x, y])
addImages(edgelessRoot.std, [img], { point: [x, y] })
.then(blockIds => {
const imageBlockId = blockIds[0];
const imageBlock = host.doc.getBlock(imageBlockId);