Repository navigation
docs(plugins): 不写 pan 的画布显示整个 viewBox,补充设置区域画布的设计宽度 - #107
Closed
xiaoyumuxi wants to merge 2 commits into
Closed
xiaoyumuxi wants to merge 2 commits into
xiaoyumuxi wants to merge 2 commits into
Conversation
画布原来只写“按视图宽度缩放、height 点高”,窗口变宽会裁掉场景下半部分。改为:不写 pan 时按宽度缩放但不超过 height、从左上角开始;写了 pan 时不变。schema 说明同步,domains/settings.md 补桌面端区域宽度,#105 移进更新记录时间线。
xiaoyumuxi
added a commit
to 1lck/Lithe-IDEA
that referenced
this pull request
Nov 19, 2026
只按宽度缩放时,固定高度的画布在更宽的窗口里会裁掉场景下半部分。不写 pan 的画布改为按 min(宽度, height) 缩放、从左上角开始;写了 pan 的画布不变。契约说明见 Lithe-IDEA/Lithe-core-rust#107。
This was referenced Nov 19, 2026
Contributor
Author
xiaoyumuxi
added a commit
that referenced
this pull request
Nov 19, 2026
会报告宽度的宿主在每个视图事件里带 width(排版视图节点用的宽度,也是顶层画布的宽度),量到宽度之后才发 open;画布的 on 可以写 resize,宽度停止变化 400 ms 后宿主发 resize 和新的 width。契约 README 同时写明缩放为 1 时怎样放 viewBox:不写 pan 时显示整个 viewBox、从左上角开始,写了 pan 时宽度占满视图。 Core 画布校验接受 on: ["viewport", "resize"],schema 同步;Rust、Java、Node 三个 SDK 支持 width 和 resize 并补 README;settings.md 中英说明区域画布按 width 排版和旧宿主下的固定宽度;更新记录登记本次补充,并把 #105 的条目移到时间线。取代 #107。
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.
关联 Issue
height点高”在窗口变宽后会裁掉场景的下半部分,窗口变窄时又在下面留出一块空白。类型
docs:契约 README 的说明修正、schema 说明同步、设置参考页补充,以及更新记录。不新增版本号、宿主方法、通知或 SDK 版本;带
pan的画布行为不变。改动
契约 README(
shared/plugins/contract/v1/README.md)画布一节写明缩放为 1 时宿主怎样放
viewBox:pan:显示整个viewBox。它按视图宽度缩放,但高度不超过height,从区域左上角开始画。viewBox和视图一样宽、和height一样高的场景正好是一个单位一个点。pan:和原来一样。viewBox的宽度占满视图,上边对齐区域顶部,用户拖动查看下面的部分;缩小到比区域窄时,场景水平居中。schema(
shared/plugins/contract/v1/plugin-ui.schema.json)canvas的description同步上面的规则。只改说明,校验规则不变。参考文档(
shared/plugins/reference/domains/settings.md)“设置区域”的中英两段各加一条,告诉插件作者区域画布的设计宽度:区域里的画布通常不写
pan,把viewBox设成区域最窄时的宽度、高度设成height。这两个数是在桌面端最小窗口(900 点宽)里截图量出来的:更新记录(
shared/plugins/reference/protocol-changelog.md)验证
node shared/plugins/scripts/verify-docs.mjs:通过。desktop/internal/pluginview的单元测试和无头测试都已通过。新增的测试覆盖三种情况:不写pan的画布按设计宽度画、在更宽的视图里大小不变并贴左上角、在更窄的视图里按宽度缩小;写了pan的画布仍然居中。