fix: 修复上下红外框触摸屏手掌擦橡皮过大的问题 - #636
Open
fplj-fplj wants to merge 1 commit into
Open
Conversation
🤖 Augment PR SummarySummary: This PR corrects palm-eraser sizing for top/bottom infrared touch frames.
🤖 Was this summary useful? React with 👍 or 👎 |
| return contactWidthDip; | ||
|
|
||
| var min = Math.Min(contactWidthDip, contactHeightDip); | ||
| var max = Math.Max(contactWidthDip, contactHeightDip); |
There was a problem hiding this comment.
In Ink Canvas/Ink/PalmEraserGeometry.cs:37, this early return also applies when isQuadIr is true, changing the previous quad-IR result for a zero-height contact from 0 to the raw width. A quad-IR frame with a screen-wide width and a missing/degenerate height can therefore activate an oversized palm eraser again rather than being rejected by the existing threshold checks.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Contributor
|
你先别急 |
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.
问题
在具有上下红外框的触摸屏上使用“手掌擦”时,橡皮尺寸巨大,远超实际手掌。
原因
非四边红外路径直接使用接触矩形的 Width 作为手掌擦尺寸。上下红外框可能把接触矩形某一轴上报为接近全屏宽度的异常长条,导致手掌擦被异常放大。
修改
PalmEraserGeometry,统一计算有效接触宽度:异常细长接触使用sqrt(width * height)近似真实手掌尺寸,并增加 200 DIP 上限。MW_TouchEvents.GetTouchBoundWidth()和手掌擦激活逻辑接入新计算。NativeInkInputRouter.TryGetPalmEraserWidth()同步同一逻辑,保持两处公式一致。验证