浏览代码

fix button bug in flutter

fix a bug in flutter, see the comments upon the fix for details
/siyaoH-1.17-PlatformMessage
xingweizhu 4 年前
当前提交
4fc2ef91
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 7
      com.unity.uiwidgets/Runtime/material/button.cs

7
com.unity.uiwidgets/Runtime/material/button.cs


position: center,
hitTest: (BoxHitTestResult boxHitTest, Offset offsetPosition) => {
D.assert(offsetPosition == center);
return child.hitTest(boxHitTest, position: center);
//WARNING: inconsistent with flutter (zxw): I believe that there is a bug here in flutter
//in flutter, the following line is "return child.hitTest(boxHitTest, position: center); ". This is nonsense since it will always return true regardless of the value of the input parameter: position.
//we have tested a bit in flutter and found that, since an inputPadding has a Semantics as it parent which shares the same size, the Semantics's hitTest can hide this bug in flutter
//Therefore this bug only occurs in UIWidgets
//We are not very clear whether this is the best fix though. Please feel free to optimize it
return child.hitTest(boxHitTest, position: position);
}
);
}
正在加载...
取消
保存