Skip to content

fix(clickgui): 裁剪区外的设置不再误点 - #186

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/repository-first-pass-maintenance-d074
Closed

fix(clickgui): 裁剪区外的设置不再误点#186
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/repository-first-pass-maintenance-d074

Conversation

@cursor

@cursor cursor Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

关联

Follow-up to #185

判断

#185 把嵌套 pushClip 改成与外层求交,画面不会溢出面板。Prism 的 UiFrame.clicked 仍用设置行的原始矩形做 consumePressInBounds,点面板下方或蒙层仍可能点到看不见的开关。

这里不改 Prism、不再做一套 clip 语义:EdgeInput 直接用 #185 已经维护的 EdgeCanvas clip 栈,把控件命中盒与当前视口求交。

改动

  • Scissor.constrainHit / hasArea:把 widget 矩形收缩到当前 clip;不重叠则不消耗按下
  • EdgeInput 的点击 / 滚轮 / 拖拽 / markHovered 走求交后的矩形
  • consumePressOutside 不动(点外关闭弹层的语义不变)

剩余

UiFrame.hovered 仍是 Prism 里的 Hit.inside,不走 EdgeInput。看不见的行可能还会高亮,但不会再偷点击。要连 hover 一起修,得改 Prism。

验证

  • ./gradlew test --tests "top.fpsmaster.utils.render.gui.ScissorIntersectTest" 通过
  • ./gradlew test 通过
  • 无法在本环境跑 1.8.9;请人工打开 ClickGUI → 优化 → 展开 Performance,点面板下方 / 蒙层,确认看不见的开关不会被点到

测试清单

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

Reuse the EdgeCanvas clip stack for hit-tests so expanded settings
that are only visually clipped cannot consume presses below the panel.

Co-authored-by: Gao Yu <gaoyu06@users.noreply.github.com>
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.

2 participants