fix(clickgui): 裁剪区外的设置不再误点 - #186
Closed
cursor[bot] wants to merge 1 commit into
Closed
Conversation
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>
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.
关联
Follow-up to #185
判断
#185 把嵌套
pushClip改成与外层求交,画面不会溢出面板。Prism 的UiFrame.clicked仍用设置行的原始矩形做consumePressInBounds,点面板下方或蒙层仍可能点到看不见的开关。这里不改 Prism、不再做一套 clip 语义:
EdgeInput直接用 #185 已经维护的EdgeCanvasclip 栈,把控件命中盒与当前视口求交。改动
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通过测试清单