fix(gesture): 修复跟进 2.1.0 后横滑切换简介/评论区再次难以触发 - #141
Closed
wm-develop wants to merge 0 commit into
Closed
Conversation
Member
Author
|
Merged. |
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.
原因
#98 的修复由三部分组成,其中「鸿蒙下将竖向 touchSlop 覆盖为 8」这一项写在
MyApp._scaledBuilder的 MediaQuerycopyWith参数里,两条分支各写了一份。跟进 2.1.0(1aebdefe3)时上游重写了uiScale == 1.0分支的整个copyWith,该参数被静默丢弃;而手机上 uiScale 恒为 1.0,等于这条覆盖从未执行过。竖向 slop 于是退回鸿蒙引擎下发的 ~1.48 逻辑像素(ArkUI PanGesture 的 5vp 被当作 physicalTouchSlop 下发,框架又除了一次 DPR),与横向的 12 形成约 8:1 的差距 —— 只有约 7° 以内近乎纯水平的滑动才抢得到手势竞技场。
另两项(touchSlopH 默认值 24→12、方向判定 dx > 3·dy → dx > dy)完好,但如 #98 所述,它们单独无法生效。
修复