Skip to content

fix(clickgui): 展开优化选项不再溢出面板 - #185

Merged
gaoyu06 merged 1 commit into
mainfrom
cursor/repository-first-pass-maintenance-77c1
Aug 27, 2026
Merged

fix(clickgui): 展开优化选项不再溢出面板#185
gaoyu06 merged 1 commit into
mainfrom
cursor/repository-first-pass-maintenance-77c1

Conversation

@cursor

@cursor cursor Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

关联

Fixes #184

判断

这是一个可复现、范围清楚的 ClickGUI 溢出 bug,不是缺复现或高风险改动。

「优化」里的 Performance 有 50+ 项设置。展开后模块卡片高约 950px,而 ClickGUI 面板最高 310px。Prism 的 SharedClickGui 会先 clip 模块列表视口,再 clip 展开设置区。Edge 的 EdgeCanvas.pushClip 原来是直接覆盖 scissor,不与外层相交,popClip 也不恢复外层矩形。设置区的 clip 比面板高,内容就会画出 chrome 外。

改动

  • EdgeCanvas 维护 clip 栈:嵌套 pushClip 与当前视口求交,popClip 恢复上一层
  • Scissor.intersect 提供纯矩形求交,方便测试
  • 未改 Performance 设置结构,未改 Prism 依赖

验证

  • ./gradlew test --tests "top.fpsmaster.utils.render.gui.ScissorIntersectTest" 通过
  • ./gradlew test 通过
  • 无法在本环境跑 1.8.9 客户端;请人工打开 ClickGUI → 优化 → 展开 Performance,确认设置被 clip 在面板内并可滚动

测试清单

  • 主要逻辑已用单测覆盖
  • 未改无关文件
  • 已在 1.8.9 上手工确认(需人工)
Open in Web View Automation 

Nested pushClip replaced the list scissor, so expanding Performance
drew settings past the ClickGUI chrome. Intersect and restore clips.

Co-authored-by: Gao Yu <gaoyu06@users.noreply.github.com>
@gaoyu06
gaoyu06 marked this pull request as ready for review August 27, 2026 03:45
@gaoyu06
gaoyu06 merged commit d71b208 into main Aug 27, 2026
4 checks passed

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

第一遍审查(不批准)。对照的是 a978719...24fae09,三个文件:EdgeCanvas clip 栈、Scissor.intersect、求交单测。

判断: 改法对上 Prism 的嵌套 clip。Scroll.begin 先 clip 模块列表视口,展开模块再 pushClip 设置区;两者都是同一套布局坐标(Scroll 用 offset 改 y,不 translate)。旧实现是覆盖 scissor,Performance 设置区约 950px、面板最高 310px,会画出 chrome。求交并在 popClip 恢复外层是对的。单层 clip(歌词全屏等)行为不变。空集时 glScissor(0,0,0,0) 可以。

CI build / build-native 已绿。ScissorIntersectTest 覆盖了主路径求交、相离、负宽度;没有 EdgeCanvas 栈恢复的测(依赖 GL/MC)。

需要人工确认(这仓已 merge,当残余验收):

  1. 1.8.9:ClickGUI → 优化 → 展开 Performance,设置被 clip 在面板内且列表可滚。
  2. 点击测试不走 clip 栈(见下方 inline)。展开后点面板下方/蒙层,确认不会误触已 clip 掉的设置。若会,修正应在 Prism UiFrame.clicked/hovered,不是这次 Edge 的 clip 栈。

没有在这个已 merge 的分支上推代码。

Open in Web View Automation 

Sent by Cursor Automation: Edge 前置维护

float[] parent = clips.peek();
float[] next = parent == null
? new float[] {x, y, w, h}
: Scissor.intersect(parent[0], parent[1], parent[2], parent[3], x, y, w, h);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里只求交 GL scissor。Prism UiFrame.clicked / hovered 仍用原始矩形(Hit.inside / consumePressInBounds),不看这个栈。

Scroll.begin clip 的是列表视口;Performance 设置行的 layout box 仍可以伸出面板。画面被 clip 后,点面板下方或蒙层仍可能点到看不见的开关。

请在 1.8.9 上确认这种误点。若复现,改 Prism 的 hit-test,不要在 Edge 再改一套 clip 语义。

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

开另一个 pr 修复此问题

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已另开 #186,在 Edge 侧把点击与 #185 的 clip 栈求交:看不见的设置行不再消耗按下。

#185 已合并,这里不改。UiFrame.hovered 仍是 Prism 的 Hit.inside,只能修误点;hover 高亮要改 Prism。

View PR

Open in Web View Automation 

Sent by Cursor Automation: Edge 前置维护

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clickgui

2 participants