From b41fec906b95ad2556f26193301f1bdd188209ba Mon Sep 17 00:00:00 2001 From: MoonLL Date: Thu, 18 Dec 2025 11:15:10 +0800 Subject: [PATCH] =?UTF-8?q?[201=5F38]=20=E9=80=9A=E8=BF=87=E7=B2=98?= =?UTF-8?q?=E8=B4=B4=E6=8F=92=E5=85=A5=E7=9A=84=E5=9B=BE=E7=89=87=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=B1=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devel/201_38.md | 6 ++++++ src/Edit/Replace/edit_select.cpp | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/devel/201_38.md b/devel/201_38.md index 0e14938a6..ad31e42bf 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 291b74191..bee04977e 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); } -- Gitee