diff --git a/devel/201_38.md b/devel/201_38.md index 0e14938a6494c6eb833dd321406931286937c412..ad31e42bf192a66b44445e7bd12121cfb2c790d6 100644 --- a/devel/201_38.md +++ b/devel/201_38.md @@ -2,6 +2,12 @@ ## 如何测试 + 新建一个空文档,菜单栏选择 **插入->图片->插入图片** ,查看插入的图片是否是居中的 ++ 新建一个空文档,复制一张图片,菜单栏选择 **编辑->粘贴** 或使用快捷键 **ctrl+v**,查看插入的图片是否是居中的 + +## 2025/12/18 通过粘贴插入的图片默认居中 + +### What +让通过粘贴插入的图片默认居中放置。 ## 2025/12/17 通过插入图片选项插入的图片默认居中 diff --git a/src/Edit/Replace/edit_select.cpp b/src/Edit/Replace/edit_select.cpp index 291b7419120a9770a0b43793f0159ed3103bcb6a..bee04977e3c82519de62515257d1acdb1917d217 100644 --- a/src/Edit/Replace/edit_select.cpp +++ b/src/Edit/Replace/edit_select.cpp @@ -698,6 +698,11 @@ edit_select_rep::selection_paste (string key) { else fm= selection_import * "-snippet"; tree doc= generic_to_tree (s, fm); if (is_func (doc, DOCUMENT, 1)) doc= doc[0]; // temporary fix + if (is_func (doc, IMAGE)) { + tree with (WITH); + with << tree ("par-mode") << tree ("center") << doc; + doc = with; + } if (mode == "math" && is_compound (doc, "math", 1)) doc= doc[0]; insert_tree (doc); }