Repository navigation
[6016] 修复窗口尺寸调整导致非 automatic 介质文档冗余重排的问题 - #4710
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题描述
在
edit_interface_rep::handle_notify_resize中,原实现无条件向编辑引擎发送notify_change (THE_TREE + THE_FREEZE)。对于非
automatic介质(如常见的paper纸张排版或固定版面):page-type(如 A4、A5)严格确定,每行的断点与整篇排版布局与应用程序窗口尺寸完全无关;THE_EXTENTS;THE_TREE会使排版引擎误以为文档树结构发生改变,从而导致全文档重新执行分页计算(pager->make_pages)。在加载包含数万段落、数十万图元的超大长文档时:
resizeEvent,导致全文档被无谓地重复分页排版 4 次以上,单次分页遍历几十万图元耗时数秒,造成长达 15 秒以上的主线程假死;修复方案
根据文档当前的
PAGE_MEDIUM区分派发变更标志:PAGE_MEDIUM == "automatic"时,行宽依赖窗口宽度,继续按需标记THE_TREE + THE_FREEZE;THE_EXTENTS + THE_FREEZE,仅更新视口与滚动条范围。性能测试